Denis
Denis

Reputation: 795

macOS: getting AVAudioFile readIntoBuffer: progression

On MacOS, in Objective-C, I need to read an audio file to convert it in WAV.Reading of the file is made in creating an AVAudioFile then apply the readIntoBuffer: method to it, in order to fill an AVAudioPCMBuffer.

As the readIntoBuffer: method can take some time for big audio files (for instance about 25 seconds for a 4-hour file on a M1 Max Mac Studio), I would like to display a progress bar to inform the user of the state of this reading operation. I cannot find any property to query from a NSTimer firing block, neither on the AVAudioFile instance nor on the AVAudioPCMBuffer instance.

Any idea of a mean to get information about the bytes or frames read while the buffer is ongoing filling? Thanks!

Upvotes: 0

Views: 39

Answers (0)

Related Questions