avaudiorecorder在录制后播放时会扭曲声音

时间:2011-05-09 16:03:34

标签: iphone ios avaudioplayer avaudiorecorder

我使用了avaudiorecoder来记录用户的声音。它记录下来,但是当我播放它时,声音就会发出噼啪声。任何关于此的帮助将被赞赏.....遵循我的录音机设置的代码..

NSDictionary *recordSetting =[[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber      numberWithInt:kAudioFormatAppleIMA4],AVFormatIDKey,
                                      [NSNumber numberWithInt:16000.0],AVSampleRateKey,
                                      [NSNumber numberWithInt: 1],AVNumberOfChannelsKey,
                                      [NSNumber numberWithInt:16],AVLinearPCMBitDepthKey,
                                      [NSNumber numberWithBool:NO],AVLinearPCMIsBigEndianKey,
                                      [NSNumber numberWithBool:NO],AVLinearPCMIsFloatKey,
                                      [NSNumber numberWithInt:AVAudioQualityMax],AVEncoderAudioQualityKey,
                                      nil];

1 个答案:

答案 0 :(得分:3)

为什么使用16000 Hz的采样率?可能是噪音,因为采样率不够快?使用PCM时,通常的采样率为44100 Hz。 也许这篇文章可以帮助你: How do I record audio on iPhone with AVAudioRecorder?