• 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
Respecting Audio MIDI channel setup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Respecting Audio MIDI channel setup


  • Subject: Respecting Audio MIDI channel setup
  • From: Stevo Brock <email@hidden>
  • Date: Wed, 16 Jun 2010 00:55:34 -0700

Hello,

We have a customer issue where the audio is going out the wrong outputs in the customer's hardware (configuration image http://www.sunsetmagicwerks.com/images/AudioMidi.tiff). The customer says that other apps like iTunes and Quicktime Player play stereo audio out the hardware channels 5 & 6 whereas our applications play stereo audio out the hardware channels 1 & 2.  Also attached below is our code to initialize Core Audio Playback which seems pretty basic and straightforward to me.

What are we doing or not doing that is affecting the system in this way?

-Stevo Brock
 Head of Development
 Monkey Tools, LLC
 www.monkey-tools.com



	if (sOutputUnitComponent == nil) {
		// Open Default Output Unit
		ComponentDescription	desc;
		desc.componentType = kAudioUnitType_Output;
		desc.componentSubType = kAudioUnitSubType_DefaultOutput;
		desc.componentManufacturer = kAudioUnitManufacturer_Apple;
		desc.componentFlags = 0;
		desc.componentFlagsMask = 0;
		sOutputUnitComponent = ::FindNextComponent(nil, &desc);

		// We find it?
		if (sOutputUnitComponent == nil) {
			// No
			// Open AUHAL
			desc.componentType = kAudioUnitType_Output;
			desc.componentSubType = kAudioUnitSubType_HALOutput;
			desc.componentManufacturer = kAudioUnitManufacturer_Apple;
			desc.componentFlags = 0;
			desc.componentFlagsMask = 0;
			sOutputUnitComponent = ::FindNextComponent(nil, &desc);
		}
	}

	// We need one of them!
	ThrowIfNil(sOutputUnitComponent);

	// Open Output Unit
	error = MAKE_OSUError(::OpenAComponent(sOutputUnitComponent, &mPrivateData->mOutputUnit));
	ReportErrorAndReturnError(error, "opening component");
	mPrivateData->mComponentOpened = true;

	// Initialize
	error = MAKE_OSUError(::AudioUnitInitialize(mPrivateData->mOutputUnit));
	ReportErrorAndReturnError(error, "initializing output unit");
	mPrivateData->mOutputUnitInitialized = true;

	// Get output format
	Boolean	writable;
	UInt32	size;
	::AudioUnitGetPropertyInfo(mPrivateData->mOutputUnit,
			kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0, &size,
			&writable);

	error = MAKE_OSUError(::AudioUnitGetProperty(mPrivateData->mOutputUnit,
			kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 0,
			&mPrivateData->mOutputFormat, &size));
	ReportErrorAndReturnError(error, "getting output unit output format");

	// Set input format to match
	error = MAKE_OSUError(::AudioUnitSetProperty(mPrivateData->mOutputUnit,
			kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0,
			&mPrivateData->mOutputFormat, size));
	ReportErrorAndReturnError(error, "setting output unit input format");

	// Set render callback
	AURenderCallbackStruct	callback;
	callback.inputProc = sOutputUnitFillBuffer;
	callback.inputProcRefCon = mPrivateData;
	error = MAKE_OSUError(::AudioUnitSetProperty(mPrivateData->mOutputUnit,
			kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &callback,
			sizeof(AURenderCallbackStruct)));
	ReportErrorAndReturnError(error, "setting render callback for output unit");



 _______________________________________________
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: Respecting Audio MIDI channel setup
      • From: Jeff Moore <email@hidden>
  • Prev by Date: Re: long double data type
  • Next by Date: Re: long double data type
  • Previous by thread: Re: Question on ExtAudioFileRead and AudioBuffer for iPhone SDK
  • Next by thread: Re: Respecting Audio MIDI channel setup
  • Index(es):
    • Date
    • Thread