使用AudioKit录制时如何降低噪音

时间:2018-03-27 07:57:40

标签: ios swift audiokit

我正在使用AudioKit录制音频并在录制和播放音频时显示可视化工具。 它运行良好,但录制的音频有很多背景噪音。

有没有办法减少噪音? 这是准备录制的代码

func prepareForRecording() {
    AKSettings.defaultToSpeaker = true
    // Patching
    outputPlot.node = mic
    micMixer = AKMixer(mic)
    micBooster = AKBooster(micMixer)

    // Microphone monitoring is muted
    micBooster.gain = 0 // Silent
    recorder = try? AKNodeRecorder(node: micMixer)
    if let file = recorder?.audioFile {
        player = try? AKAudioPlayer(file:file)
    }
    player?.completionHandler = playingEnded

    moogLadder = AKMoogLadder(player)

    mainMixer = AKMixer(moogLadder, micBooster)

    AudioKit.output = mainMixer

    if isMicPresent {
        AudioKit.stop()
        AudioKit.start()
    }
    currentSeconds = 0
    timer?.invalidate()
    timer = nil
}

0 个答案:

没有答案