views:

54

answers:

1

I am writing a program that needs to deal with multiple audio inputs.

I am currently using AudioQueues to get the input, but this is only from the default input device.

Is there any way to either:

  • Select which input device the AudioQueues use.
  • Change the default input device.

I know that I can use kAudioHardwarePropertyDevices in Core-Audio to get a list of output devices, is there a similar one I can use for input devices?

+2  A: 

kAudioHardwarePropertyDevices is used for both output and input devices. Devices can have both input and output channels, or can have only input or output channels.

Most of the AudioDevice... functions take a Boolean isInput parameter so that you ca query the input side of the device.

lucius
Thanks! I just found kAudioHardwarePropertyDefaultInputDevice which should do the job nicely.Unfortunately the AudioDevice functions are deprecated so I have to use AudioObjectGetPropertyData instead, but that doesn't have a boolean for isInput. Any idea how to distinguish from input and output devices using this method?
DanieL
Take a look at [Tech Note TN2223](http://developer.apple.com/mac/library/technotes/tn2010/tn2223.html) "Moving Off Deprecated HAL APIs". I think you'd set `AudioObjectPropertyScope` to select input or output.
lucius
To distinguish between input and output , get the `AudioStreamID(selector:kAudioDevicePropertyStreams)` from `AudioStreamID` get channel direction selector:`kAudioStreamPropertyDirection`. The direction 0 indicates output channel and 1 indicates input channel.
Devara Gudda