FP10 SoundAPI changes

Without telling anyone, Adobe changed the Sound API on the recent released Flash Player 10. When we released our AudioTool yesterday we encountered a ridiculous long latency of almost one second. The latency time is the time between computation of the sound and the point where you can listen to the actual sound. It is important to keep this value low for live experience. After hours of research some people figure out, that the amount of samples you pass to the sound card is changing the latency dynamically BUT will never decrease. If you once pass a higher number of samples you cannot go back easily.

Here is how we handled sound creation before in the AudioTool
We simply passed 2048 samples (minimum amount) every time the SampleCallbackEvent was fired. The playback was stable – even when scrolling the desktop with a lot of devices. For processes that would block the CPU for some time (e.g. create new plugin instances), we passed 8192 sample (maximum amount) to remain stable playback and execute the processes after. So we dynamically increased the latency once to have more space for heavy computation. Afterward we went back to normal (2048 samples). In fact this worked great!

The Release Player changed all that
With the latest player, every time you increase the number of samples you will increase the overall latency. And there is no way of decreasing it again without stopping the SoundChannel. So now we just pass 3072 samples (~160ms latency) all the time. Meaning that critical processes won’t be caught and will cause gaps in playback.

Again we now have 4 times more latency, but playback is overall less stable.

The worst thing is, that nobody told us and I am still not sure, what that is all about. The new sound feature was great and worked great for all release candidates. And all the sudden they changed it – again – without telling anyone. If we had this information before, it would not have been so hard to accept it. And of course we may have found some workarounds.

Read also Joe Berkovitz post | Joa Ebert post | Kai-Philipp Schöllmann post

16 thoughts on “FP10 SoundAPI changes”

  1. I truely hope this is a bug regression of some sort, but it’s unfortunate that it got introduced to the release version like this. Please do post when you’ve filed a bug report, and I’ll go in there and vote it up as well.

  2. Sad sad sad.

    I’m also quite pissed off about the FileOpen dialog “security” measures that breaks existing Flash9 applications.

    Looks like Adobe turned what was a nice update of the player into a big headache for us developers…

  3. This is really sad. I hope for soon Adobe react and change things back, if they was better before. Guys, you done reat work and Adobe should take this in account. I hope for good end.

  4. Part of this may be explained by this paragraph from Tinic’s original ‘Adobe Is Making Some Noise Part 2’ post:

    “There is an internal buffer in the Flash Player which is about 0.2 to 0.5 seconds depending on the platform which is preventing drop outs. It will automatically be increased if drop outs occur. This internal buffer is the key for the high latency I was alluding to earlier. You should never depend on a certain latency with this API in your application. To enforce this there is a slight random factor in choosing this buffer size when the Flash Player launches.”

  5. Can anybody help in reading the header information from the ByteArray of an MP3 file loaded …. basically I want to find the BITRATE from the mp3 header. Thanks in advance … pls send the suggestions/solutions to lintoka123@gmail.com

Comments are closed.