Record Streaming Audio from currently playing video in AVPlayer

倖福魔咒の 提交于 2019-12-04 15:58:11
Drakes

One source suggests you listen for audio routing changes when the AVPlayer and AVAudioRecorder are started at the same time. The idea is to use AudioSessionAddPropertyListener(...) and monitor kAudioSessionProperty_AudioRoute audio routes, then start the recording when you receive the AVPlayer route.

REF: Playing video with AVPlayer and recording sound with AVAudioRecorder simultaneously

Another solution is to use MTAudioProcessingTap (ref), set up a stream handler using KVObserving, and record your streaming video's audio channel.

REF: Recording Live Audio Streams on iOS

Another solution is to just start an audio session of category AVAudioSessionCategoryPlayAndRecord with a delegate, and initiate the audio recording after you have started playing the video.

REF: how can i record a song which is playing with AVPlayer and an wav file at a same time?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!