|
From: Chris B. <ch...@cn...> - 2010-04-19 19:08:47
|
On Mon, Apr 19, 2010 at 1:23 PM, TJF <tjf...@we...> wrote: > >> Or you can just play while resampling using the "wavaudio" output format... > Thank you, Chris > > Is there a way to play raw files while resampling? Yes, example3.c is doing exactly this but using Linux alsa audio output instead. Change sox_open_write() to have filetype of "waveaudio" instead of "alsa" and it will play audio from an input file to windows audio drivers. Since your working with raw input file, you'll need to create a sox_signalinfo_t with correct in->signal.rate and in->encoding values initialized before called sox_open_read(). Pass this structure in instead of NULL pointer that example is using. example3.c is meant to work with audio that has headers to get this information from. Also, instead of passing &in structure to sox_open_write(), you'll want to create a copy of that and change its sample rate to whatever your resampling to before calling sox_open_write(). This tells both what to set audio hardware sample rate to and also what tells logic to add "rate" effect to effect's chain. Chris |