FP10 SoundAPI changes

October 16th, 2008

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

Filed under: actionscript

16 Responses to “FP10 SoundAPI changes”

  1. David R Says:
    October 16th, 2008 at 4:28 pm

    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. Adobe made some creepy noise at Adobe, MAKE SOME NOISE Says:
    October 16th, 2008 at 5:27 pm

    [...] information Andre Michelle blog Joe Berkovitz blog Kai-Philipp Schöllmann [...]

  3. lee Says:
    October 16th, 2008 at 5:56 pm

    Ouch, that’s no good, thanks for the heads up!

  4. Nicolas Says:
    October 16th, 2008 at 9:36 pm

    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…

  5. Franto Says:
    October 17th, 2008 at 8:09 am

    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.

  6. Blog von Jens Franke » Das Arbeiten in einer Welt voller APIs Says:
    October 17th, 2008 at 9:14 am

    [...] wollte ich mir einen Beitrag zum Flash Player 10 sparen, aber die sehr geschätzten Kollegen André Michelle und Joa Ebert haben mich dann doch dazu bewegt zumindest indirekt darüber zu [...]

  7. Willem Says:
    October 17th, 2008 at 4:09 pm

    Very disappointing.

    Thanks for the information.

    Best of luck to you all at Hobnox.

  8. localToGlobal » Blog Archive » news review -> 42th week of 2008 Says:
    October 17th, 2008 at 5:22 pm

    [...] > Andre Michelle » Blog Archive » FP10 SoundAPI changes [...]

  9. Matt Rix Says:
    October 17th, 2008 at 9:57 pm

    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.”

  10. links for 2008-10-18 at suckmypixel Says:
    October 18th, 2008 at 2:30 pm

    [...] Andre Michelle » Blog Archive » FP10 SoundAPI changes Discussion on flash 10 issue with latency and the new sound buffer functionality (tags: flash sound code workaround) [...]

  11. Hobnox - Audiotool, update | ????tv?? Says:
    October 20th, 2008 at 5:02 pm

    [...] Kai-Philip ???Hobnox, next level…????????? ?? Andre Michelle ???FP10 SoundAPI changes?Flash Player 10????????Sound [...]

  12. Andre Michelle » Blog Archive » Sound API changes - Calming down Says:
    October 21st, 2008 at 1:47 pm

    [...] There is actually nothing to add, but probably a better explanation is necessary to comprehend, why I was so disturbed of Adobes latest changes in the Sound API. I just want to make clear that I am not interest in spending time in fighting rather enhancing. [...]

  13. Websites tagged "instances" on Postsaver Says:
    March 5th, 2009 at 10:32 am

    [...] properties and fields saved by danboe2009-02-25 – Instances Galore saved by mattiemac2009-02-25 – FP10 SoundAPI changes saved by bleulayette2009-02-21 – Rewind or Fast-Forward? saved by JonasBrothersMusic2009-02-20 – [...]

  14. Linto Says:
    July 7th, 2009 at 7:30 am

    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

  15. JavaScript synthesizer | Toverlamp.org Says:
    December 27th, 2010 at 1:11 am

    [...] There are various flash apps online where you can try this. However, flash has a very limited sound support. Since Flash 10 this has been improved, but after a promising beta the final version has very bad latency. [...]

  16. A Non-Eulogy – “Six Shades of Flash” « hireTed Says:
    August 5th, 2012 at 1:44 pm

    [...] is pretty powerful with dealing with audio and video. Adobe did drop the ball a few times, but it helped make YouTube a major video contender, and there are some nifty [...]