[linux-audio-dev] Jack and sample rate conversion : realtime or not ?

Tom Szilagyi tszilagyi at users.sourceforge.net
Thu Mar 24 08:39:22 UTC 2005


On Thu, Mar 24, 2005 at 12:40:23AM +0100, Olivier Guilyardi wrote:
> Hi,
> 
> If playing a sound file that has a different framerate from Jack, using
> libsamplerate, should I :
> 
> - convert in real time, in the process callback ?
> - convert the whole file into memory when loading it ?

Hi,

my music player Aqualung (http://aqualung.sf.net) does the former,
however not in the JACK process callback (since it also supports ALSA
and OSS output) but in the disk thread which reads and decodes audio
files and resamples them (if necessary) in a buffer-by-buffer manner
via libsamplerate so it can be sent to the output thread.

If you're interested in the details, you may look at src/core.c in the
Aqualung codebase. Beware, though, that it's not particularly easily
readable by humans :)

Loading the whole file into memory sounds a bit pathologic IMHO (no
offense incl.)


Tom



More information about the Linux-audio-dev mailing list