仅录制来自iPhone扬声器(不包括麦克风)的音频输出 [英] Recording audio output only from speaker of iphone excluding microphone

查看:180
本文介绍了仅录制来自iPhone扬声器(不包括麦克风)的音频输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从iPhone扬声器录制声音.我能够做到这一点,但是我无法避免在录制的输出中出现麦克风输入.尝试了在其他网站上没有运气的示例代码.

I am trying to record the sound from iPhone speaker. I am able to do that, but I am unable to avoid mic input in the recorded output. Tried with sample code available in different websites with no luck.

我使用的样本使用音频单元进行录音.我需要知道音频单元是否具有将麦克风输入音量设置为零的任何属性.最重要的是,我来自其他职位,音频队列服务可以为我做这件事.任何人都可以使用示例代码重定向我,以执行音频队列服务.在将数据作为输入发送给扬声器之前,我需要知道是否有一种将数据写入单独的音频文件的方法.

The sample which I used does the recording with audio units. I need to know if there is any property for audio unit to set the mic input volume to zero. Above that I came to from other posts that Audio Queue services can do the thing for me. Can any one redirect me with sample code for the audio queue services implementation. I need to know whether there is a way of writing the data to an separate audio file before sending it as input to speaker.

预先感谢

推荐答案

没有用于记录发送到iPhone扬声器的通用音频的公共iOS API或属性.只能录制麦克风输入.

There is no public iOS API or property for recording generic audio sent to the iPhone speaker. Only mic input can be recorded.

但是,如果您仅使用带有音频队列或RemoteIO音频单元的未压缩样本来播放应用程序中的音频,则只需将这些样本复制到文件中,然后再将其写入音频回调缓冲区即可.那些保存的样本可用于构建记录.

But if you are playing audio in your app using only uncompressed samples with Audio Queues or the RemoteIO Audio Unit, you can just copy those samples to a file before you write them to the audio callback buffers. Those saved samples can be used to construct a recording.

这篇关于仅录制来自iPhone扬声器(不包括麦克风)的音频输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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