简体   繁体   English

是否可以在iPhone上以AAC / MP4格式录制音频?

[英]Is it possible at all to record audio in AAC/MP4 format on the iPhone?

In this link it says it does: http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html 它在此链接中表示确实: http : //developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html

However I have searched for an example that works on the web and can only see people complaining they can't get it to work. 但是,我搜索了一个可以在网络上使用的示例,只能看到有人抱怨他们无法使它正常工作。 I have a working AudioQueue example for PCM but the very moment I switch this to AAC initialization fails. 我有一个适用于PCM的AudioQueue示例,但是将其切换为AAC初始化的那一刻就失败了。 SpeakHere example also only uses PCM. SpeakHere示例也仅使用PCM。

Has anyone ever managed to make this work or has a link to a code snippet that works? 有没有人设法做到这一点,或者有链接到有效的代码段?

Basically iPhone only record PCM. 基本上,iPhone只记录PCM。 To get an AAC encoded file the original PCM stream should be stored into a AudioFile and then this AudioFile should be converted to AAC. 要获取AAC编码的文件,应将原始PCM流存储到AudioFile中,然后将此AudioFile转换为AAC。

There's no way to record and convert on the fly on iPhone unless you include a third-party library that will do this for you. 除非您包括可以为您完成此操作的第三方库,否则无法在iPhone上即时记录和转换。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM