For the past few days, I’ve been trying to implement a feature which gives a user an option to record part of the audio she’s listening to. Specifically:
In my app, I have an
AVPlayer that plays remote audio files. While the audio is playing, the user can hold a button and as long as the button is being held, playing audio is being saved.
My problem with
AVPlayer is that as much as I researched, it seems that there isn’t a way how to access an audio buffer as long as the underlying
AVAsset is a remote audio file.
On the other hand, I could use
AVAudioEngine where I could easily access the buffer but the engine (and underlying
AudioNodes) don’t support remote audio files out of the box.
I was hoping that I could get away without writing ale the networking code and edge cases for audio streaming.
My questions are:
- Is there a way I could access the audio buffer of
AVAudioEngine(or some other object) without writing all the code for audio streaming?
- Or is there any other way of grabbing currently playing audio (in the same app that plays the audio)?