Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 录音后播放时,录音机会使声音失真_Iphone_Ios_Avaudioplayer_Avaudiorecorder - Fatal编程技术网

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。 也许这篇文章可以帮助你: