Computing file sample position when using AUConverter
Computing file sample position when using AUConverter
- Subject: Computing file sample position when using AUConverter
- From: Philippe Wicker <email@hidden>
- Date: Fri, 29 Oct 2004 07:29:14 +0200
Hi all,
I'm currently implementing samples streaming from disk. I've decided to
cache audio data after their conversion from the file format to the
canonical format. This conversion may need sample rate conversion and
is realized using an AUConverter. The cache manages audio chunks as
equal size pages that may be stolen to a sample and reused by another.
When the sample "client" needs a page that is not loaded (or stolen)
it then requests data from the disk. I have therefore to convert a
position into the local (converted) sample to a position in the sample
on the disk. Not a problem when no SRC is needed, both positions are
equals in that case. When SRC is needed, I can use the sample rate
ratio but I need an additional information: the "offset", or the
"prefetched" samples needed by the AUConverter. Usually, SRC needs some
samples around the target position.
I'm assuming that these trailing or leading frames are added to the
input size only for the first call after an AUConverter reset (and that
these additional frames are internally saved by the AUConverter). Is
it right?
Can I use the kConverterPrimeMethod_Xxxxx property to get this info?
Putting aside the case of samples containing loop locators, the access
to a sample is sequential. Could I use the
kAudioConverterPropertyCalculateInputBufferSize property to
incrementally compute the file position? Is this property aware of
leading and trailing frames?
Thanks,
Philippe Wicker
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