• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
AudioQueue - Setting channel layout
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: AudioQueue - Setting channel layout
      • From: Doug Wyatt <email@hidden>
    • Keyboard problems in Logic
      • From: john smith <email@hidden>
  • Prev by Date: Re: Questions on mixing .wav files
  • Next by Date: Re: Wrapper class for Cocoa Audio Units in Carbon Hosts
  • Previous by thread: Re: Questions on mixing .wav files
  • Next by thread: Keyboard problems in Logic
  • Index(es):
    • Date
    • Thread