Re: DIGI001 zero channels!
Re: DIGI001 zero channels!
- Subject: Re: DIGI001 zero channels!
- From: Brad Ford <email@hidden>
- Date: Mon, 7 Jun 2004 13:18:40 -0700
Ethan,
You've got a problem with your code below. You aren't doing an
AudioDeviceGetPropertyInfo call first to see how much space you need to
allocate for your buffer list. This code won't work on any device that
presents more than one stream, since you've only passed it an
AudioBufferList that can hold one audio buffer. You need to do:
AudioBufferList bufferlistPtr = NULL;
AudioDeviceGetPropertyInfo(theDevice, 0, false,
kAudioDevicePropertyStreamConfiguration, &theSize, NULL);
bufferlistPtr = malloc(theSize);
AudioDeviceGetProperty(... kAudioDevicePropertyStreamConfiguration,
&theSize, bufferlistPtr);
// now iterate over all the buffers as you did below.
free(bufferlistPtr);
-Brad Ford
QuickTime Engineering
On Jun 6, 2004, at 3:13 PM, Ethan Funk wrote:
I use the following code to get a count of the Input and Output
channels available on a audio device. This code works fine for all the
devices I have tested so far except for Digidesign's DIGI001 interface.
I get a channel count of ZERO in and out. Even when the same program
is connected and playing audio through the device, I still get zero
channels counted. Is this a bug with the Digidesign driver or am I
doing something wrong in my code?
Ethan Funk
nOUTChan = 0;
theSize = sizeof(AudioBufferList);
OSerr = AudioDeviceGetProperty(
theDevice, 0, false,
kAudioDevicePropertyStreamConfiguration,
&theSize, &chanList);
if (!OSerr){
for (j=0; j < chanList.mNumberBuffers; j++)
nOUTChan = nOUTChan +
chanList.mBuffers[j].mNumberChannels;
}
nINChan = 0;
theSize = sizeof(AudioBufferList);
OSerr = AudioDeviceGetProperty(
theDevice, 0, true,
kAudioDevicePropertyStreamConfiguration,
&theSize, &chanList);
if (!OSerr){
for (j=0; j < chanList.mNumberBuffers; j++)
nINChan = nINChan +
chanList.mBuffers[j].mNumberChannels;
}
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.