[Lazarus] How to play audio from memory.

Donald Ziesig donald at ziesig.org
Wed May 11 22:53:35 CEST 2016


Hi All!

Is there any Free Pascal code that can play audio directly from memory?

I would like to be able to play the equivalent of a .WAV file through 
the stereo output jack of a Raspberry Pi.

Currently I am able to do this by calling omxplayer with a file name and 
volume information.  Unfortunately, the latency between starting 
omxplayer and the beginning of the audio output is several seconds which 
is unacceptable for my application.  I can't determine whether the 
latency comes from loading omxplayer's executable or reading the audio 
file, or both, but if I could have the code as part of the fpc 
executable and the audio data already in memory, I believe the latency 
will be as low as possible.

Any suggestions will be appreciated.

Don Ziesig




More information about the Lazarus mailing list