Record audio streamed from AVPlayer

断了今生、忘了曾经 提交于 2019-12-06 05:34:05

问题


I'm trying to record/capture audio that's being streamed via an AVPlayer. The AVAudioRecorder only records from the microphone which may work if the audio is played via speakerphone (although quality will suffer) but it'll definitely not work if the headphones are plugged in.

I've looked everywhere for a solution but still haven't found a solution that'll work for me. Would I need to grab the audio buffer? Is there another way to capture what's being played?


回答1:


You can grab audio buffers by adding an MTAudioProcessingTap to your AVPlayer.

The process is a little convoluted, but there is some information out there.




回答2:


The easiest approach nowadays is to play and record using AVAudioEngine.



来源:https://stackoverflow.com/questions/33004383/record-audio-streamed-from-avplayer

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