• 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
Simple HAL multichannel I/O question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple HAL multichannel I/O question


  • Subject: Simple HAL multichannel I/O question
  • From: Wayne <email@hidden>
  • Date: Sun, 19 Sep 2010 13:36:54 -0700

I'm trying to output multichannel audio using pretty basic HAL calls. When I get the kAudioUnitProperty_StreamForamt, we can see the device supports 8 channels, however when our RenderProc is hit the AudioBufferList only contains two channels.

What are we missing?


Wayne
----

	OSErr err = noErr;
	AudioStreamBasicDescription theFormat;
	UInt32 theSize = sizeof(AudioStreamBasicDescription);
	memset(&theFormat, 0, sizeof(AudioStreamBasicDescription));

	Component comp;
	ComponentDescription desc;

	desc.componentType = kAudioUnitType_Output;
	desc.componentSubType = kAudioUnitSubType_HALOutput;
	desc.componentManufacturer = kAudioUnitManufacturer_Apple;
	desc.componentFlags = 0;
	desc.componentFlagsMask = 0;
	comp = FindNextComponent(NULL, &desc);
	err = OpenAComponent(comp, &mOutputStream);
	err = AudioUnitGetProperty(mOutputStream, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &theFormat, &theSize);
		// can see at this point that theFormat.mChannelsPerFrame is == 8
	AURenderCallbackStruct input;
	input.inputProc = RenderCallbackProc;
	input.inputProcRefCon = this;
	err = AudioUnitSetProperty( mOutputStream,
			kAudioUnitProperty_SetRenderCallback,
			kAudioUnitScope_Global,
			0,
			&input,
			sizeof(input));
	err = AudioUnitInitialize(mOutputStream);
	err = AudioOutputUnitStart(mOutputStream);

// audio starts

static OSStatus	RenderCallbackProc(void *	inRefCon,
	AudioUnitRenderActionFlags *ioActionFlags,
	const AudioTimeStamp *		inTimeStamp,
	UInt32 	inBusNumber,
	UInt32 	inNumberFrames,
	AudioBufferList *			ioData)
{
	// can see at this point that ioData->mNumberBuffers == 2
} _______________________________________________
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: Simple HAL multichannel I/O question
      • From: Doug Wyatt <email@hidden>
    • Re: Simple HAL multichannel I/O question
      • From: tahome izwah <email@hidden>
  • Prev by Date: AULab not showing channel strips?
  • Next by Date: AUAudioFilePlayer - stopping, resuming and playing from the start
  • Previous by thread: AULab not showing channel strips?
  • Next by thread: Re: Simple HAL multichannel I/O question
  • Index(es):
    • Date
    • Thread