Can Flash do low latency synthesis?

When synthesizing sound using the SAMPLE_DATA event of the Sound class, the Flash documentation recommends recording as many samples as possible up to 8192. On my system, the sound is muted unless I write at least 4192 samples of each event. This is the full tenth of a second that will be noticeable to the user.

I may have the option of buffering things ahead of time, but this is a major annoyance to my application. Is there a way to get a lower latency output?

+3


source to share


1 answer


Unfortunately, it SAMPLE_DATA

is the main means of audio synthesis, and it has different performance and latency between platforms. For the lowest latency, it is best to provide as few samples as possible (2048) c SampleDataEvent

.



There is also Sound.loadPCMFromByteArray , which was added in Flash Player 11 and allows you to load samples directly into a regular Sound object. While this wouldn't be useful for dynamic, real-time sound synthesis, it allows you to pre-generate sound and play it back when you need it.

+2


source







All Articles