我有一些录音代码工作,但记录的音频(从iPod touch内部麦克风)是非常嘈杂.
这是我的配置:
AVAudioSession *audioSession = [AVAudioSession sharedInstance]; NSError *err = nil; [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:&err]; if (err) { NSLog(@"audioSession: %@ %d %@",[err domain],[err code],[[err userInfo] description]); return; } [audioSession setActive:YES error:&err]; err = nil; if (err) { NSLog(@"audioSession: %@ %d %@",[[err userInfo] description]); return; } recordSetting = [[NSMutableDictionary alloc] init]; // We can use kAudioFormatAppleIMA4 (4:1 compression) or kAudioFormatLinearPCM for nocompression [recordSetting setValue:[NSNumber kAudioFormatLinearPCM] forKey:AVFormatIDKey]; // We can use 44100,32000,24000,16000 or 12000 depending on sound quality [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey]; // We can use 2 (if using additional h/w) or 1 (iPhone only has one microphone) [recordSetting setValue:[NSNumber numberWithInt:1] forKey:AVNumberOfChannelsKey]; // These settings are used if we are using kAudioFormatLinearPCM format [recordSetting setValue:[NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey]; [recordSetting setValue:[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsBigEndianKey]; [recordSetting setValue:[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsFloatKey];
我在这里有不好的配置,还是有不同的方式来减少录音中的噪音?据我所知,有一些录音机应用在那里是无噪音的.
解决方法
要做到这一点,你必须做一些数字信号处理.您将不得不创建一个您听到的噪音的特征,而没有什么进入麦克风.换句话说,您必须指定正在记录或拾取的白噪声.您将使用数字声音处理(DSP)进行所有这些表征.然后,您可以录制您的音频,并减去您之前描述的白噪声.