Re: what determines how many channels in the buffers supplied to the remoteIO output callback?
Re: what determines how many channels in the buffers supplied to the remoteIO output callback?
- Subject: Re: what determines how many channels in the buffers supplied to the remoteIO output callback?
- From: Morgan Packard <email@hidden>
- Date: Wed, 15 Aug 2012 21:59:26 -0400
Figured out what was going on. The format was non-interleaved stereo, and seeing
ioData->mBuffers[0].mNumberChannel == 1, I assumed that the remoteIO callback was giving me a single, mono buffer, when in fact it was giving me two, non-interleaved buffers.
-m-
On Wed, Aug 15, 2012 at 9:48 PM, Thomas Hass
<email@hidden> wrote:
Make sure the other members of the ASBD match your desired channel count. For instance, this ASBD gives me mono:
AudioStreamBasicDescription format = {0};
UInt32 bytesPerSample = sizeof(Float32);
UInt32 numChannels = 1;
format.mFormatID = kAudioFormatLinearPCM;
format.mFormatFlags = kAudioFormatFlagIsFloat | kAudioFormatFlagIsPacked;
format.mFramesPerPacket = 1;
format.mChannelsPerFrame = numChannels;
format.mBytesPerFrame = numChannels * bytesPerSample;
format.mBytesPerPacket = numChannels * bytesPerSample;
format.mBitsPerChannel = bytesPerSample * 8;
format.mSampleRate = 44100.0;
Changing numChannels to 2 in this case gives me a stereo interleaved buffer in ioData.
Hope this helps,
-Thomas
On Tue, Aug 14, 2012 at 2:45 PM, Morgan Packard
<email@hidden> wrote:
Hello,
I've set an AudioStreamBasicDescription for kAudioUnitScope_Input, bus 0 on my audio unit, and verified that this asbd is actually "sticking" by querying it again after I set it. In this asbd, mChannelsPerFrame is 2. However, in my render callback, I'm getting passed mono buffers via ioData.
Should setting the number of channels in the AudioStreamBasicDescription correctly set the number of channels in the render callback? If not, what do I need to do to set the number of channels?
thanks,
-Morgan
--
===============
Morgan Packard
aim: mpackardatwork
twitter: @morganpackard
_______________________________________________
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
--
===============
Morgan Packard
cell: (720) 891-0122
aim: mpackardatwork
twitter: @morganpackard
_______________________________________________
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