使用AVAudioSession进行AAC录音的最佳设置是什么? [英] What is an optimal setting for AAC voice recording with AVAudioSession?

查看:80
本文介绍了使用AVAudioSession进行AAC录音的最佳设置是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在iPhone上录制语音,并生成一个针对小尺寸和录音质量而优化的文件。使用下面的AAC设置,文件较小,但是我不确定质量是否达到最佳。除了反复试验之外,我还有什么可以找的,或者有什么建议吗?

I'm looking to record voice on the iPhone and produce a file that is optimized for small size and recording quality for voice. With the settings below for AAC I'm getting a small file size, but I'm not sure I'm getting optimal quality. Other than trial and error, is there anything I can turn to, or any recommendations?

[recordSetting setValue:[NSNumber numberWithFloat:8000.0] forKey:AVSampleRateKey];
[recordSetting setValue:[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey]; 
[recordSetting setValue:[NSNumber numberWithInt: 1] forKey:AVNumberOfChannelsKey];
[recordSetting setObject:[NSNumber numberWithInt:AVAudioQualityLow] forKey: AVEncoderAudioQualityKey]; 
[recordSetting setValue:[NSNumber numberWithInt: 8000] forKey:AVEncoderBitRateKey];


推荐答案

有几种针对语音优化的编解码器,包括 iLBC 。以8kHz的采样率使用iLBC将导致每小时记录大约7MB的文件。

There are several codecs which are optimized for voice, including iLBC. Using iLBC at the 8kHz sample rate that you have will result in a file that is approximately 7MB per hour of recording.

这篇关于使用AVAudioSession进行AAC录音的最佳设置是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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