【发布时间】:2014-03-13 05:47:48
【问题描述】:
在 ios 中录制语音时哪种音频格式较小?质量不一定是最好的,但用户所说的内容应该是可以理解的。
【问题讨论】:
-
查看这篇文章中的所有链接。它可以帮助你stackoverflow.com/questions/1761460/…
标签: ios iphone core-audio audio-recording audioformat
在 ios 中录制语音时哪种音频格式较小?质量不一定是最好的,但用户所说的内容应该是可以理解的。
【问题讨论】:
标签: ios iphone core-audio audio-recording audioformat
假设您打算使用AVAudioRecorder 类,您应该像这样提供录制设置 -
NSDictionary *recordSettings = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:AVAudioQualityMin], AVEncoderAudioQualityKey,
[NSNumber numberWithInt:16], AVEncoderBitRateKey,
[NSNumber numberWithInt: 2],AVNumberOfChannelsKey,
[NSNumber numberWithFloat:44100.0], AVSampleRateKey,nil];
NSError* error = nil;
AVAudioRecorder audioRecorder = [[AVAudioRecorder alloc]
initWithURL:soundFileURL
settings:recordSettings
error:&error];
Apple's documentation 提供有关您可以在应用中使用的设置常量(特别是 AVEncoderAudioQualityKey)的详细信息。
【讨论】:
AVEncoderBitRateKey 的问题,是每秒千比特吗?还是每秒位数?
单声道 22.05KHz 对于语音来说绰绰有余,在相同位深度下是立体声 44.1KHz 大小的 1/4。您甚至可以尝试将其降低到 11.025KHz。
【讨论】:
一些 iOS 应用使用Speex 编码器来实现较低比特率的语音。它不是内置的,但可以使用开源的source code 进行编码。
【讨论】: