Play sound fast

Nicolas Dufresne nicolas.dufresne at
Sun Jul 5 15:57:41 CEST 2009

Le dimanche 05 juillet 2009 à 14:37 +0200, Visti Andresen a écrit :
> I prefer using RAM and have the sound swapped out if memory is
> tight...

Personally I would try other solution before going to the RAM solution.
The RAM solution will move the latency to your program startup time,
which is also a big issue. You could also decode and embed the sound in
a raw char* format but that will make the program less configurable (it
will also increase you program size, and thus slow down startup time).

When you launch a sub-process, you need to load all the file to RAM
first, which is not the case for an audio file. For this reason, I would
suggest to test usinga streaming stack like GStreamer library. If all
your pipeline are brought to pause state (preroll and buffering done),
latency should be very low when time comes to play. You may get even
lower latency by enabling mmap() mode of your filesrc element.

Best regards,

More information about the devel mailing list