How to reduce noise while recording with AudioKit

穿精又带淫゛_ 提交于 2019-12-04 03:39:51

问题


I am using AudioKit to record audio and display visualizer while recording and playing audio. It works good, But recorded audio has lots of background noise.

Is there any way to reduce noise? Here is the code for prepare recording

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
}

来源:https://stackoverflow.com/questions/49507343/how-to-reduce-noise-while-recording-with-audiokit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!