如何记录在iPhone用户产生的声音输出 [英] How to record user generated sound output on iPhone

查看:161
本文介绍了如何记录在iPhone用户产生的声音输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一系列的声音,用户会玩,重新排列和编辑等,而使用我的应用程序。当用户完成后,我希望他们能够保存他们的工作,并记录到MP3。

I have a series of sounds that a user will play, rearrange, and edit etc. while using my app. When the user is finished, I want them to be able to save their work and record it to an mp3.

我不想通过扬声器播放它,并与MIC录音它,因为这将导致低音质和干扰。我不能想到的,不需要额外的硬件和/或计算机这样做的任何方式。

I don't want to play it through speakers and record it with the mic since that will result in low sound quality and interference. I cannot think of any ways of doing this that doesn't require extra hardware and/or a computer.

我怎样才能做到这一点只用他们的设备?

How can I do this using just their device?

推荐答案

好吧,我会说这是无法和AVFoundation来完成。

Well, I would say it cant be done with AVFoundation.

我的建议是使用音频单元,所有的互动转化为音频图形。在某些时候你设置一个渲染所以它呈现听起来你得到一个回调扬声器每次在RemoteIO通知在这里,您可以在这些帧/包/数据记到一个文件中。

My suggestion is to use Audio Units, and transform all your interactions to an audio graph. at some point you set a render notify on the RemoteIO so every time it renders sounds to the speakers you get a callback where you can write it down those frames/packets/data into a file.

我可能会建议在MP3使用的AAC(M4A)。我不是很喜欢的MP3,而且说实话,据我所知道的SDK并不MP3可能是由于许可证问题提供编码。我可能是错的。检查下面这个示例code,可能是最好的样本code,你会找到在网络上的音频单元。

I will probably suggest to use AAC(m4a) over MP3. I am not very fond of MP3, and to be honest as far as I know the sdk does not provide encoding to MP3, probably due to licensing issues. I could be wrong though. Check this sample code below, probably the best sample code you will ever find on Audio units on the web.

AudioGraph由汤姆·珠海国际赛车场

这篇关于如何记录在iPhone用户产生的声音输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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