Re: AudioStreamBasicDescription for kAudioFormatMPEGLayer2
Re: AudioStreamBasicDescription for kAudioFormatMPEGLayer2
- Subject: Re: AudioStreamBasicDescription for kAudioFormatMPEGLayer2
- From: William Stewart <email@hidden>
- Date: Wed, 6 Jun 2007 12:44:24 -0700
Just PCM
You would also need a layer 2 audio decoder which isn't available on
a Tiger system. Compressed formats are handled by the AudioConverter,
and there are APIs with AudioFormat to determine what decoders (and
encoders) are available on the system.
To play a file with encoded data, you could use the PlayFile example
as a starting point. To convert a file ConvertFile. These are found
in the SimpleSDK folder
Bill
On 05/06/2007, at 12:28 PM, mike woodworth wrote:
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
_______________________________________________
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