我正在使用AudioKit来显示AKNodeOutputPlot的录音电平。我必须显示一行,它将说出适当的音频电平来录制音频。 我必须在-10 dB处画线。我怎样才能做到这一点?这是我的示例代码(Swift 4)。
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
而我想在10 dB上显示这条线的图形。
如何以10dB绘制线条并绘制波形图形?