录制从AVPlayer流式传输的音频

录制从AVPlayer流式传输的音频

本文介绍了录制从AVPlayer流式传输的音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试录制/捕获通过 AVPlayer 进行流式传输的音频。 AVAudioRecorder 只能从麦克风录制,如果通过扬声器播放音频可能会有效(虽然质量会受到影响),但如果插入耳机,它肯定无法工作。

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?

推荐答案

您可以通过向您的 MTAudioProcessingTap 来获取音频缓冲区code> AVPlayer 。

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.

这篇关于录制从AVPlayer流式传输的音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 17:08