简体   繁体   English

在进行音频会话录音时如何减少录音噪音?

[英]How to reduce recording noise when recording with audio sessions?

I got some recording code working, but the recorded audio (from the iPod touch internal microphone) is very noisy. 我可以使用一些录制代码,但是录制的音频(来自iPod touch内部麦克风) 非常嘈杂。

This is my configuration: 这是我的配置:

    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 domain], [err code], [[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];

Do I have bad config here or is there a different way to reduce noise in the recorded audio? 我的配置不好吗?还是有其他方法可以减少录制音频中的噪音? There are some voice recorder apps out there that are noise free as far as I can tell. 据我所知,那里有一些录音机应用程序无噪音。

To do this you would have to do some Digital Signal Processing. 为此,您必须进行一些数字信号处理。 You would have to create a characterization of the noise you hear while nothing is going into the mic. 当麦克风没有任何声音时,您将必须对所听到的噪声进行表征。 In other words, you would have to specify the white noise that is being recorded or picked up. 换句话说,您将必须指定正在记录或拾取的白噪声。 You would do all of these characterizations with Digital Sound Processing (DSP). 您将使用数字声音处理(DSP)进行所有这些表征。 Then you can record your audio and subtract the white noise that you characterized earlier. 然后,您可以录制音频并减去之前表征的白噪声。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM