AudioKit在AKNodeOutputPlot中绘制音量级别的行

时间:2018-03-27 08:14:26

标签: ios swift audiokit

我正在使用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

输出如下所示 enter image description here

而我想在10 dB上显示这条线的图形。

enter image description here

如何以10dB绘制线条并绘制波形图形?

0 个答案:

没有答案