Read an AVAudioFile into a buffer starting at a certain time

818 Views Asked by At

Let's say I have an AVAudioFile with a duration of 10 seconds. I want to load that file into an AVAudioPCMBuffer but I only want to load the audio frames that come after a certain number of seconds/milliseconds or after a certain AVAudioFramePosition.

It doesn't look like AVAudioFile's readIntoBuffer methods give me that kind of precision so I'm assuming I'll have to work at the AVAudioBuffer level or lower?

1

There are 1 best solutions below

0
On BEST ANSWER

You just need to set the AVAudioFile's framePosition property before reading.