Hello all,
I'm *very* new to core audio. I'm just starting to dig into my first project with it. I need to preview an mpeg layer 2 stream to the default AU. I've setup the default output and established a render callback. I then build an asbd and use AudioUnitSetProperty to set the default output's kAudioUnitProperty_StreamFormat. Next I call AudioUnitInitialize, but I'm getting an error of 'fmt?'. Am I skipping any necessary steps? Or am I just formatting the asbd wrong? This is what I have:
AudioStreamBasicDescription streamFormat;
streamFormat.mSampleRate = 48000;
streamFormat.mFormatID = kAudioFormatMPEGLayer2;
streamFormat.mFormatFlags = 0;
streamFormat.mBytesPerPacket = 0;
streamFormat.mFramesPerPacket = 0;
streamFormat.mBytesPerFrame = 0;
streamFormat.mChannelsPerFrame = 2;
streamFormat.mBitsPerChannel = 16;
Any suggestions?
From my reading, I can't determine if the DefaultOutputUnit is capable of converting from any format to the hardware native format, or just from any PCM format to the hardware native PCM format.
thanks,
mike
--
Mike Woodworth
email@hidden