AVURLAsset.duration on AAC-compressed files is not returning the correct sample count.
AVURLAsset.duration on AAC-compressed files is not returning the correct sample count.
- Subject: AVURLAsset.duration on AAC-compressed files is not returning the correct sample count.
- From: Heinrich Fink <email@hidden>
- Date: Wed, 01 Aug 2012 10:48:32 +0200
Fellow CoreAudio programmers,
As you probably all know, compressed audio files contain a certain amount of zeroed samples at the beginning and at the end of a file (prime and remainder samples). As I understand, for very accurate scheduling, or looping scenarios, it is desirable to only deal with the actual valid audio samples, i.e. all samples excluding the prime/remainder samples.
I am having trouble retrieving the number of ’valid’ samples via AVURLAsset’s ‘duration’. This property always returns the full number of samples (incl. prime and remainder samples). I haven’t found any way of how to determine the ‘valid’ number of sample via AVFoundation at all, there seems to be no backdoor using CMAudioFormatDescription or related (note that the ExtAudioFile API would return the correct amount of samples via the property kExtAudioFileProperty_FileLengthFrames).
Does anyone know how to retrieve the correct amount of ‘valid’ samples using AVFoundation?
I know that this issue is not directly related with CoreAudio, but I was hoping that someone on this list might have had experience with this issue.
best regards,
Heinrich
p.p.s. If someone wonders why I haven’t used ExtAudioFile in first place: I need to read QuickTime movie files which aren’t accessible via the ExtAudioFile API.
_______________________________________________
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