Setting an aggregate device to appear to be stereo
Setting an aggregate device to appear to be stereo
- Subject: Setting an aggregate device to appear to be stereo
- From: Dave Addey <email@hidden>
- Date: Thu, 03 Aug 2006 14:22:58 +0100
- Thread-topic: Setting an aggregate device to appear to be stereo
Title: Setting an aggregate device to appear to be stereo
Hi all,
I’m trying to use aggregate devices to make a stereo “wrapper” device from a real multi-channel device.
My problem is that I don’t know how to make the aggregate device appear to only have two channels. I’m testing with a 6-channel eMagic EMI 2:6. When I first create the aggregate device, using just the EMI 2:6, it correctly reports an AudioChannelLayout with mChannelLayoutTag = kAudioChannelLayoutTag_UseChannelDescriptions, and it has six channel descriptions, all set to kAudioChannelLabel_Unknown.
I’ve been trying to set a new value of kAudioDevicePropertyPreferredChannelLayout on the aggregate device, with a layout tag of kAudioChannelLayoutTag_Stereo, on the assumption that I can then set kAudioDevicePropertyPreferredChannelsForStereo to choose the two channels I want to use. I’m also assuming that the aggregate device will then “be” stereo. Here’s the code I’m using:
// create a new ACL for stereo
AudioChannelLayout newACL;
newACL.mChannelLayoutTag = kAudioChannelLayoutTag_Stereo;
// set the new ACL on the aggregate device
osErr = AudioDeviceSetProperty(outAggregateDevice, NULL, 0, false, kAudioDevicePropertyPreferredChannelLayout, sizeof(newACL), &newACL);
if (osErr != noErr) {
printf("AudioDeviceSetProperty returned %i\n", osErr);
return osErr;
}
Whenever I try this, AudioDeviceSetProperty returns “!siz”, so there must be something up with the size of this new ACL. It’s certainly smaller in size than the existing one (which has six channel descriptions), but that’s to be expected. Any idea what I’m doing wrong? Is this the right way to make an aggregate device appear to be stereo, even if it is not?
In case you’re wondering, I’m doing this to wrap a multichannel device in a stereo “aggregate” device, so that I can pass the stereo device to QuickTime and get the benefit of kRenderQuality_Medium when using QuickTime’s new pitch-fixing abilities. Unfortunately, kRenderQuality_Medium isn’t available for anything more than a stereo device mix right now.
Any help much appreciated!
Dave.
_______________________________________________
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