AudioQueue input device seems to be auto switching...
AudioQueue input device seems to be auto switching...
- Subject: AudioQueue input device seems to be auto switching...
- From: Neil Clayton <email@hidden>
- Date: Tue, 4 Dec 2007 08:47:01 +1300
Hi,
I've just been experimenting (learning) about AudioQueues, and have my
own version of AQRecord going. All good.
It records OK, both CBT/AAC - as expected.
I've been playing around now with recording specific devices. My
queue setup is thus (error handling removed):
- (void) setupQueue {
OSStatus err = AudioQueueNewInput(&description, HandleInputBuffer,
self, nil, kCFRunLoopCommonModes, 0, &queue);
// Setup the device being used
if(device) {
[self log:@"Using device %@ as the source", device];
CFStringRef deviceUID = (CFStringRef)[device.device deviceUID];
err = AudioQueueSetProperty(queue,
kAudioQueueProperty_CurrentDevice, &deviceUID, sizeof(CFStringRef));
}
// Now reget the AudioStreamBasicDescription in order to make sure
it's properly filled out
UInt32 size = sizeof(description);
err = AudioQueueGetProperty(queue,
kAudioConverterCurrentOutputStreamDescription, &description, &size);
}
This works OK, but if I then change the default input device, AQ
appears to make attempts to follow it. I see a brief (perhaps 5s)
pause while it matches the device, and then it continues recording.
The final result is a somewhat garbled audio file since the devices
I'm switching between all have different formats (so I end up sounding
like a certain disney mouse!).
As far as I know I've not setup the recording device to be "default",
and no err is returned from setting kAudioQueueProperty_CurrentDevice.
Is this intended behavior? And if so, how do I disable it?
--
Regards,
Neil Clayton, http://shinywhitebox.com
_______________________________________________
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