Re: accurate method for detecting number of output channels?
Re: accurate method for detecting number of output channels?
- Subject: Re: accurate method for detecting number of output channels?
- From: Jeff Moore <email@hidden>
- Date: Wed, 17 May 2006 11:53:47 -0700
The problem here is that you program is looking at the format of only
one stream of the device. This is probably because you are using the
obsolete device-level format properties such as
kAudioDevicePropertyStreamFormat. The proper way to find out what
format a device is using is to first get the list of streams and then
to iterate through the streams and look at the format of each one.
Were you doing this, you would discover that the Mbox is actually a
collection of several mono streams, which is a common configuration
for audio devices.
Since you are really only interested in the number of channels in
this case, you can use kAudioDevicePropertyStreamConfiguration to
fill out an AudioBufferList that is configured like what the device
provides in the IOProc. You can sum the mNumberChannels field of each
AudioBuffer in the ABL to get the total number of channels.
Note also that kAudioFormatFlagIsNonInterleaved does not apply to
formats vended by the HAL.
On May 17, 2006, at 9:00 AM, email@hidden wrote:
My host is populating an audio output device list, filtering out
devices that do not support at least 2 channels of audio. I have
found that there are devices which report back 1 for
mChannelsPerFrame, even if they do not set the
kAudioFormatFlagIsNonInterleaved flag. For one example, the
Digidesign Mbox, using the standalone CoreAudio 7.0 drivers. I
believe that the RME Fireface 800 is another.
My program requires a stereo output. Clearly the Mbox is capable
of providing that. Are there other tests I should be using?
"Built-in audio" description
mFormatID lpcm
mFormatFlags kAudioFormatFlagsNativeFloatPacked
mBytesPerPacket 8
mFramesPerPacket 1
mBytesPerFrame 8
mChannelsPerFrame 2
mBitsPerChannel 32
"MBox" description
mFormatID lpcm
mFormatFlags kAudioFormatFlagsNativeFloatPacked
mBytesPerPacket 4
mFramesPerPacket 1
mBytesPerFrame 4
mChannelsPerFrame 1
mBitsPerChannel 32
--
Jeff Moore
Core Audio
Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden