I’m reading an audio file with AVAssetReaderAudioMixOutput. So I’ll get AudioBuffer objects with normally 2*8192 samples. Now I want to do some analysis on exactly 2*44100 samples shifted by 1024 every 1024 samples. Is there a simple way to collect an exact amount of samples? Or do I have to build that all on my own?
And is there a collection like a ring buffer that works well with AudioBuffer?
I’m reading an audio file with AVAssetReaderAudioMixOutput . So I’ll get AudioBuffer objects with
Share
The best way I found to to this is with the TPCircularBuffer (https://github.com/michaeltyson/TPCircularBuffer). It has a category that can deal directly with AudioBuffer objects. So I put them into them into the buffer until there are 2*44100 bytes in the buffer and then I remove the last 2*8192 bytes. Works like a charm!