Reputation: 17237
For basic sounds, such as sine waves or white noise, which is considered less processor intensive: looping an .mp3 file or programmatically creating the sound?
My first though was that looping an .mp3 must be less involved than programming a sound, but after reading the documentation and considering the primitive nature of these sounds i'm not so sure.
Any thoughts?
Upvotes: 3
Views: 316
Reputation: 70743
The number of CPU instructions per uncompressed sound sample is usually far less for decoding an mp3 than for algorithmically generating samples for most sounds more interesting than a square wave, especially if the actionscript interpreter and floating point math gets involved.
Upvotes: 1
Reputation: 7321
There is a well documented article on the adobe website about the sound manipulation: http://www.adobe.com/devnet/flash/articles/dynamic_sound_generation.html
It clearly depends on your needs, but looping an mp3 is quite easy. Generating a sound and looping over it seems a bit more complex even if it is feasible.
By the way, if you loop over an mp3 that is much easier to tweak the mp3 with an appropriated software. Just recompile and the updated mp3 will be played correctly.
M.
Upvotes: 1