Playing mp3 streaming audio in Flash player 10 is a resource hog.
You can play streaming mp3 audio in Flash player using the Sound object. However, there are some serious problems with this, which I feel we should make clear, since Chris’s recent outburst post did not really explain the core problem which we still face, which we have worked around in a rather unsatisfactory way. The solution works but still suffers from some unfortunate problems which become apparent on lower spec machines (and by this I mean Pentium 4 generation machines).
First and foremost, and this applies to both the AS2 + AS3 Sound objects, playing streaming audio has the effect of consuming an ever growing amount of memory. The memory allocated to the audio which has been played already is never deallocated, other than by stopping the stream. For this reason, all Flash based stream players will either bring the machine to its knees in a short time, or will require a regular covert reconnect every 10-20 minutes, which obviously causes a glitch in the music, however cleverly it is done (we do make a great effort to do it as subtly as possible).
We originally set out to write the Flash part of radiotuna.com in AS3. However, the AS3 Sound object behaves rather differently to the old AS2 Sound object: To be precise, it does not deal with mid-stream bitrate changes. This means that should the bitrate change during the course of playing the stream (which it frequently does with internet radio broadcasts, usually after an intro, or during a ‘jingle’), the sound goes very very BAD. It either sounds like its speeded up, or broken up in to chunks, since its using the bitrate declared at the start of the stream and ignoring the bitrate change embedded in the stream. This was completely unacceptable, since so many radio stations change bitrate after an initial jingle.
The old AS2 Sound object deals correctly with bitrate changes, and for this reason we chose to rewrite the stream player part of the site in AS2. However, what soon became apparent was that along with the rising memory usage, we were now seeing a linear rise in processor usage as the stream progressed, meaning that on a Pentium 4 machine the single processor was at 100% within 10-20 minutes depending on the bitrate. This of course made the machine unresponsive, again completely unacceptable. The solution of course is the same, but a sad state of affairs nonetheless.
Hopefully Adobe can address these serious problems, even if it means working with the browser vendors on how never-ending downloads are managed between browser and player.
I too would like this and other bugs in the Flash player ironed out as a priority, before introducing any more new features. New features are great, and I am particularly impressed with the iPhone announcement, but one reason I am writing this post is that since compiling for iPhone will only be for AS3, our solution will not apply. Adobe, please make sure that the AS3 Sound object respects midstream bitrate changes in future releases, and when compiled for iPhone.
