• 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
Re: CAAudioUnit fails Initialization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CAAudioUnit fails Initialization


  • Subject: Re: CAAudioUnit fails Initialization
  • From: William Stewart <email@hidden>
  • Date: Wed, 26 Apr 2006 16:38:47 -0700

Have a look at the MatrixMixer example code in the CoreAudio SDK (Developer/Examples)

On 26/04/2006, at 3:12 PM, Craig Hopson wrote:

Hopefully this is an easy one... ...with apologies because it probably has been asked before...

I am trying to use a matrix mixer as follows:

	***************** in the header *******************
	CAAudioUnit 				mMixer;
	CAStreamBasicDescription*	mStreamDesc;

	****************************************************

	ComponentResult result = noErr;
	UInt32 size;
	bool canDo;
	int numInputChans = 2;
	int numOutputChans = 1;


// create the stream description
mStreamDesc = new CAStreamBasicDescription();
mStreamDesc->SetCanonical( kNumberChannels, false ); // kNumberChannels == 2
mStreamDesc->mSampleRate = inSampleRate;


// load our mixer unit
CAComponentDescription desc = CAComponentDescription( kAudioUnitType_Mixer,
kAudioUnitSubType_MatrixMixer,
kAudioUnitManufacturer_Apple );
CAComponent mixerComp( desc );
XThrowIf( !mixerComp.IsValid(), 0, "Failed to load Mixer Component" );

require_noerr( result = CAAudioUnit::Open( mixerComp, mMixer ), bailOnErr );
// result = noErr;
#if DEBUG
mMixer.Print(); // looks like the right stuff
#endif
require_noerr( result = mMixer.Uninitialize(), bailOnErr ); // just in case...
// result == noErr;
require_noerr( result = mMixer.SetFormat( kAudioUnitScope_Input, 0, *mStreamDesc ), bailOnErr );
// result == noErr;
require_noerr( result = mMixer.SetFormat( kAudioUnitScope_Output, 0, *mStreamDesc ), bailOnErr );
// result == noErr;


	canDo = mMixer.CanDo( numInputChans, numOutputChans );
		// canDo == true;

	require_noerr( result = mMixer.Initialize(), bailOnErr );
		// result ==  -10875: kAudioUnitErr_FailedInitialization

What am I missing? What (other) properties must be set in the mixer AU before it can be initialized?

Thanks,
Craig Hopson
Red Rock Software



_______________________________________________
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

--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________ __
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________ __


_______________________________________________
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


References: 
 >CAAudioUnit fails Initialization (From: Craig Hopson <email@hidden>)

  • Prev by Date: CAAudioUnit fails Initialization
  • Next by Date: Detecting microphone activity
  • Previous by thread: CAAudioUnit fails Initialization
  • Next by thread: Detecting microphone activity
  • Index(es):
    • Date
    • Thread