问题
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