|
From: Chris B. <ch...@cn...> - 2011-02-21 21:28:34
|
On Mon, Feb 21, 2011 at 2:25 PM, Julien Eychenne <jey...@gm...> wrote: > I am trying to integrate libsox into a cross-platform Qt application (a > concordancer for sound-aligned labelling of speech). I have integrated the > source code into my application and as a first step, I'm simply using libsox > for sound playback. > The playback function is based on the code in example3.c. It works fine on > Windows and Linux, but I'm experiencing a couple of problems on Mac OS X > (10.6, macbook 4,1): > - the most outstanding one is that I'm able to flow effects only once. If I > try to play a second sound, it either doesn't play anything or segfaults > somewhere in sox_flow_effects(). I'll see if I can reproduce this. In general, I'm struggling with OS X audio driver crashes. Is there a sox command line I can use to reproduce your crash? For example, does "sox infile1 infile2 -d" also crash? Or does running example3 crash? > - the second one is that mono files seem to be played twice as fast (and > with a pitch twice as high) as they ought to (tested with FLAC and WAV > files). I worked around this by converting the input to stereo before > playback, but I thought I would mention it since it only happens on OS X. > I would appreciate any insight into these problems (especially the first > one). These problems still remain in 14.3.2-rc2. Yes, this is expected behavior. Core Audio driver only supports stereo 44100 audio data. example3.c detects input.rate != output.rate and adds in rate changer when its not 44100. It probably should be doing same with channel count and adding is mixer. So this is true for your audio app as well. I toyed with having a version of sox_create_effects_chain() to automatically added these two effects in but decided not to in the end. I was convinced on sox-devel that the order to put these into chain can be application specific and so better leave it up to app to add them in. Chris |