【问题标题】:Audio recording formats in iosios中的录音格式
【发布时间】:2014-03-13 05:47:48
【问题描述】:

在 ios 中录制语音时哪种音频格式较小?质量不一定是最好的,但用户所说的内容应该是可以理解的。

【问题讨论】:

标签: ios iphone core-audio audio-recording audioformat


【解决方案1】:

假设您打算使用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 的问题,是每秒千比特吗?还是每秒位数?
【解决方案2】:

单声道 22.05KHz 对于语音来说绰绰有余,在相同位深度下是立体声 44.1KHz 大小的 1/4。您甚至可以尝试将其降低到 11.025KHz。

【讨论】:

    【解决方案3】:

    一些 iOS 应用使用Speex 编码器来实现较低比特率的语音。它不是内置的,但可以使用开源的source code 进行编码。

    【讨论】:

      猜你喜欢
      • 2012-09-08
      • 2010-11-24
      • 2012-06-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多