Iphone 录音后播放时,录音机会使声音失真
我使用了一个音频编码器来记录用户的声音。它录了下来,但当我播放它时,声音是噼啪作响的。如果您有任何帮助,我们将不胜感激。。。。。以下是我的录音机设置的代码Iphone 录音后播放时,录音机会使声音失真,iphone,ios,avaudioplayer,avaudiorecorder,Iphone,Ios,Avaudioplayer,Avaudiorecorder,我使用了一个音频编码器来记录用户的声音。它录了下来,但当我播放它时,声音是噼啪作响的。如果您有任何帮助,我们将不胜感激。。。。。以下是我的录音机设置的代码 NSDictionary *recordSetting =[[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithInt:kAudioFormatAppleIMA4],AVFormatIDKey,
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];
为什么使用16000 Hz的采样率?是否会因为采样率不够快而产生噪音?使用PCM时,通常的采样率为44100 Hz。 也许这篇文章可以帮助你: