Re: SoundComponentData to AudioStreamBasicDescription
Re: SoundComponentData to AudioStreamBasicDescription
- Subject: Re: SoundComponentData to AudioStreamBasicDescription
- From: Bill Stewart <email@hidden>
- Date: Wed, 16 Jan 2002 10:17:26 -0800
on 16/1/02 1:49 AM, Lieven Dekeyser wrote:
>
> Why not use the AudioConverter - at least if you're just doing OS X that is
>
> a better alternative..
>
>
I know, but my app needs to be able to handle compressed variable bitrate
>
formats like mp3s, so I figured it would be best to use the SoundConverter
>
API. It enables me to handle all audio formats QuickTime can handle with
>
the same code... That's not possible with the AudioConverter, right? (only
>
fixed rate LinearPCM, right?) Or did I look over something?
At this stage yes. In the longer term we will address this shortcoming. You
might want to use the AC where you can and then fall back to the SC when you
need to. The AC will also allow for multi-channel data, which the SC won't
do.
>
>> does anyone know what mBytesPerPacket, mBytesPerFrame, mChannelsPerFrame
>
>> and mBitsPerChannel should be in the AudioStreamBasicDescription
>
>
Anyway... just ignore my last post: as it worked with the default audio
>
device, I looked at its AudioStreamBasicDescription and I'll use these
>
values...
>
>
Here's another question: Is it possible to change the buffer size of an
>
AudioUnit (the buffer you get in it's InputCallback)? Or is it allways a
>
fixed size? I noticed it was allways 4096 bytes, but that might just be
>
coincidence...
That's determined by some audio unit down the chain. In the case of a device
unit, it will pull on its sources using the buffer size of the device (HAL)
with any adjustments it needs to make for any Sample Rate conversion it is
doing.
To alter the buffer size you would alter the buffer size of the device
you're attached to - there's example code in the Java/SDK/MIDIGraph that
gives you a java version of this (easy enough to translate to C)
Bill
mailto:email@hidden
tel: +1 408 974 4056
__________________________________________________________________________
"We'll talk about it later...."
"When?"
"In a future life when we're both cats"
__________________________________________________________________________