录制音频iOS [英] Record audio iOS

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

问题描述

如何使用iOS录制音频?不是来自麦克风的输入录音,但我希望能够在我的应用中捕捉/录制当前播放的音频?

How does one record audio using iOS? Not the input recording from the microphone, but I want to be able to capture/record the current playing audio within my app?

所以,例如我开始录制会话,并且只在我的应用程序中播放任何声音,我想将其录制到文件中?

So, e.g. I start a recording session, and any sound that plays within my app only, I want to record it to a file?

我已经对此进行过研究但是我很困惑使用什么,因为看起来混合音频框架可能会导致问题?

I have done research on this but I am confused with what to use as it looks like mixing audio frameworks can cause problems?

我只是希望能够捕获并保存在我的应用程序中播放的音频。

I just want to be able to capture and save the audio playing within my application.

推荐答案

如果你想要记录你的应用产生的音频,那么这是非常有可能的。

Well if you're looking to just record the audio that YOUR app produces, then yes this is very much possible.

什么是不可能的,是录制通过扬声器输出的所有音频。
(编辑:我只是想澄清一下,没有办法记录其他应用程序产生的音频输出。你只能记录你制作的音频样本。)

What isn't possible, is recording all audio that is output through the speaker. ( I just want to clarify that there is no way to record audio output produced by other applications. You can only record the audio samples that YOU produce).

如果要录制应用的音频输出,则必须使用远程io音频设备(http://atastypixel.com/blog/using-remoteio-audio-unit/)。

If you want to record your app's audio output, you must use the remote io audio unit (http://atastypixel.com/blog/using-remoteio-audio-unit/).

你真正需要做的就是在填充后复制回放缓冲区。

All you would really need to do is copy the playback buffer after you fill it.

ex)

 memcpy(void *dest, ioData->mBuffers[0].mData, int amount_of_bytes);

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆