[linux-audio-dev] memory-mapped wav files

Stephen Sinclair radarsat1 at gmail.com
Thu Jul 13 20:45:23 UTC 2006


A thought occured to me recently...

If I am writing an application which needs to stream a large wav file,
I am having to write something which reserves some memory, and loads
pieces of the wav file from disk on request. Say I need to be able to
jump around the file a bit, I would have to detect when the piece is
not available and load it in as appropriate.

... which I realized is exactly what the OS VM paging system does.
So, has anyone tried using memory-mapped files for streaming audio
data?  (obviously, I mean, in a non-realtime thread, using a buffer).
Or would this be totally inefficient?

I was thinking it could really simplify programming, just directly
accessing parts of the wav file as needed, and letting the OS load it
up into physical memory when it wants to.

Just curious.


Steve



More information about the Linux-audio-dev mailing list