Re: Sample rate conversion of audio input device
Re: Sample rate conversion of audio input device
- Subject: Re: Sample rate conversion of audio input device
- From: Bill Stewart <email@hidden>
- Date: Mon, 29 Jul 2002 11:42:53 -0700
on 7/29/02 10:09 AM, Christof Faller wrote:
>
Thanks, Bill, for the good answer. The AudioConverter is exactly what I
>
need.
>
>
I have two more questions:
>
>
1
>
>
The usage of AudioConverterFillBuffer is clear to me, when I look at the
>
Apple sample code in
>
Developer/Examples/CoreAudio/Services/DefaultOutputUnit/UsingAudioConverter.cp>
p
>
>
I could use AudioConverterFillBuffer for my application. However for
>
minimizing the delay I would rather use AudioConverterConvertBuffer.
>
That is, because it would be better for me to at once convert the
>
complete buffer I get from the audio input device (I am working on a
>
tele-conferencing application with echo cancellation, thus I'd like to
>
have as low delay as possible).
>
>
The problem is that I need to specify for AudioConverterConvertBuffer
>
the number of input and output frames. In my case I have given the
>
number of input frames. And I don't know how many output frames this
>
will correspond to (I know it only +-1 because the SRC generates +-1
>
more or less samples when the two rates are not an even fraction).
>
>
I tried to use:
>
kAudioConverterPropertyCalculateOutputBufferSize
>
but it returns: kAudioConverterErr_FromatNotSupported
>
>
Is there a way of converting given sized buffers with
>
AudioConverterConvertBuffer and automatically always use all samples?
No - the converter is really driven by the output side.
>
That is, just convert the complete buffer and let the function tell me
>
with how many sample the conversion ended up with.
Convert buffer is only useful when you're doing a straight-forward
conversion (ie. No scaling of num samples between input and output)
There also really isn't any additional overhead associated with FillBuffer.
>
2
>
>
For the echo cancellation timing is important. Can I obtain any
>
knowledge about the delay introduced by the SRC when using
>
AudioConverterFillBuffer or AudioConverterConvertBuffer?
The converters work in real time.
If you ask the converter to fill a buffer of 512 samples, then it will do so
from the available samples that your provide on input.
Next time you call it, it will start converting from the samples that you
previously provided, then ask you for more when it needs more input to
convert for the output you've requested.
Bill
--
mailto:email@hidden
tel: +1 408 974 4056
__________________________________________________________________________
"...Been havin' some trouble lately in the sausage business," C.M.O.T.
Dibbler replied.
"What, having trouble making both ends meat?"
__________________________________________________________________________
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.