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.