From: Chris B. <ch...@cn...> - 2011-09-30 02:41:18
|
I've fixed the bug below but can't test it very well since I only have 3 audio devices (why I never saw the problem before I guess). I'm thinking a new release of SoX is probably due soon. If your not able to compile custom versions yourself... then hopefully it won't be to long. Chris On Wed, Sep 28, 2011 at 2:57 PM, Chris Bagwell <ch...@cn...> wrote: > Ouch. I think I see a bug in SoX source code. Look for how > property_size is used to see how many audio devices are in the system. > > > devices = malloc(property_size); > status = AudioHardwareGetProperty(kAudioHardwarePropertyDevices, &prop > erty_size, devices); > > if (status == noErr) > { > int i; > for (i = 0; i < property_size/sizeof(AudioDeviceID); i++) > { > char name[256]; > status = > AudioDeviceGetProperty(devices[i],0,false,kAudioDevicePropertyDeviceName,&property_size,&name); > > > We really shouldn't be basing the loop count on a variable that is > re-init'ed inside the for loop. > > I'll test it out later and commit a fix. > > Chris > > On Wed, Sep 28, 2011 at 2:40 PM, Schumacher Marlon > <mar...@mu...> wrote: >> Hi, >> >> Hmmm, unfortunately I don't know the internal workings of coreaudio that well. All I can say is that the other audio devices show up in Audio Midi Setup and Sound preferences as in the screencap below. >> >> >> >> >> ...and this is what sox returns for the command "/Applications/sox-14.3.2/sox -V6 -n -t coreaudio unknown" : >> >> ------------------------ >> /Applications/sox-14.3.2/sox: SoX v14.3.2 >> time: Feb 27 2011 10:42:10 >> uname: Darwin Marlon-MBPro-2.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386 >> gcc: 4.2.1 (Apple Inc. build 5646) (dot 1) >> arch: 1248 48 44 L OMP >> /Applications/sox-14.3.2/sox INFO nulfile: sample rate not specified; using 48000 >> >> Input File : '' (null) >> Channels : 1 >> Sample Rate : 48000 >> Precision : 32-bit >> >> /Applications/sox-14.3.2/sox INFO coreaudio: Found Audio Device "Built-in Microphone" >> >> /Applications/sox-14.3.2/sox INFO coreaudio: Found Audio Device "Built-in Input" >> >> /Applications/sox-14.3.2/sox INFO coreaudio: Found Audio Device "Built-in Outpu" >> >> /Applications/sox-14.3.2/sox FAIL formats: can't open output file `unknown': can not open audio device >> ------------------------ >> >> -apparently sox doesn't find the other devices... or the 'query' is not correct? >> >> Marlon >> >> On 2011-09-28, at 15:03 , Chris Bagwell wrote: >> >>> I'm not sure why these would not show up in list. If they present >>> themselves as audio devices then as far as I know they should show up >>> via coreaudio queries. >>> >>> I believe the SoX coreaudio driver is using same OS functions to get >>> the list that most other apps are. >>> >>> Chris >>> >>> On Wed, Sep 28, 2011 at 12:44 PM, Schumacher Marlon >>> <mar...@mu...> wrote: >>>> Hi, >>>> >>>> Sorry for the late reply. Thanks, this works. >>>> However, I can only see the coreaudio devices. Is there a way to 'query' other audio devices in the system, too? >>>> (e.g. I can't see other drivers such as Soundflower, JackRouter or external devices). >>>> >>>> Marlon >>>> >> >> >> ------------------------------------------------------------------------------ >> All the data continuously generated in your IT infrastructure contains a >> definitive record of customers, application performance, security >> threats, fraudulent activity and more. Splunk takes this data and makes >> sense of it. Business sense. IT sense. Common sense. >> http://p.sf.net/sfu/splunk-d2dcopy1 >> _______________________________________________ >> Sox-users mailing list >> Sox...@li... >> https://lists.sourceforge.net/lists/listinfo/sox-users >> >> > |