AudioQueue - Setting channel layout
AudioQueue - Setting channel layout
- Subject: AudioQueue - Setting channel layout
- From: Richard Bannister <email@hidden>
- Date: Sat, 8 Aug 2009 17:08:49 +0100
Folks,
I'm having a considerable amount of trouble trying to set up a channel
layout for playback of audio -- Mac -- calling AudioQueueSetProperty
with my kAudioQueueProperty_ChannelLayout invariably returns -66683.
However, if I try with the below to get the correct size of the
channel layout the code also fails, this time with -66684.
What on earth am I doing wrong?
// Make a format description
memset(&fmt, 0, sizeof(AudioStreamBasicDescription));
fmt.mFormatID = kAudioFormatLinearPCM;
fmt.mFormatFlags = kAudioFormatFlagIsSignedInteger |
kAudioFormatFlagIsPacked;
fmt.mSampleRate = audio_sample_rate;
fmt.mChannelsPerFrame = audio_channels;
fmt.mBitsPerChannel = audio_bits;
fmt.mBytesPerFrame = fmt.mChannelsPerFrame * (fmt.mBitsPerChannel >>
3);
fmt.mFramesPerPacket = 1;
fmt.mBytesPerPacket = fmt.mBytesPerFrame * fmt.mFramesPerPacket;
// Create output queue if needed
status = AudioQueueNewOutput(&fmt, &play_callback, &playbits,
CFRunLoopGetCurrent(), kCFRunLoopCommonModes, 0, &q_output);
if (status != noErr)
{
printf("PLAYBACK: Unable to create output queue, error %i\n",
status);
return;
}
status = AudioQueueGetPropertySize(q_output,
kAudioQueueProperty_ChannelLayout, &cls);
if (status != noErr)
{
printf("PLAYBACK: Unable to get size of channel layout, error %i
\n", status);
return;
}
Thanks
Richard
_______________________________________________
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