Re: AudioConverter input/output buffer size and more...
Re: AudioConverter input/output buffer size and more...
- Subject: Re: AudioConverter input/output buffer size and more...
- From: Chris Rogers <email@hidden>
- Date: Mon, 28 Jul 2003 18:40:22 -0700
Philippe,
Especially when doing sample rate conversion, the AudioConverter may pull
some extra frames from your input, so when you ask for
the CalculateInputBufferSize property, you will get a number larger than
what you would calculate based purely on sample rate ratios. In your
case, there were 37 more sample frames and this corresponds to trailing
frames in the default mode of the converter (prime method == normal).
If you have valid sample data in your stream, past the samples you wanted
to convert, then you should supply these as your extra 37 sample frames
that the converter input callback wants. Otherwise if you're at
end-of-stream, simply provide 37 samples frames whose values equal
0.0 (silence) for the extra.
Leading frames only apply in kConverterPrimeMethod_Pre, and I hope the
comment in AudioConverter.h can explain this better than I am able
in this email. This is really a more advanced usage, and I think
wouldn't be interesting for most clients. It really applies to a case
where you're converting a range of audio in the middle of a stream of
audio, where
you have access to the audio data both before and after the range
of audio you want to convert (with sample-rate conversion).
It provides a way to get smoother seams at the beginning and end of
your output.
Chris Rogers
Core Audio
Apple Computer
>
3. Under the same condition, if I change the sample rate of the
>
source format to 48000.0, then I obtain 1152 on input for an
>
output size of 1024. This is about 37 more than what would have
>
given the sample rate ratio (48000/44100) * 1024. Why these extra
>
samples? Trailing frames?
>
>
4. Any guidelines about trailing and leading frames values when
>
using PrimeMethod_pre or normal?
>
>
Thanks for any answer.
>
>
Philippe Wicker
>
email@hidden
>
_______________________________________________
>
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.
_______________________________________________
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.