【问题标题】:AudioKit how to update plot to change color or prototypeAudioKit 如何更新绘图以更改颜色或原型
【发布时间】:2017-12-09 12:42:28
【问题描述】:

我已使用 AudioKit 示例代码进行麦克风分析,但我不知道如何更改绘图/图表。

 func setupPlot() {

    let plot = AKNodeOutputPlot(mic, frame: audioInputPlot.bounds)
    plot.plotType = .buffer
    plot.shouldFill = false
    plot.shouldMirror = false
    plot.color = color
    audioInputPlot.addSubview(plot)

}

我想在按下按钮时更改 plot.color 。我该怎么做?

【问题讨论】:

    标签: ios swift audio audiokit


    【解决方案1】:

    我认为这里唯一的问题是您将 plot 声明为局部变量,并且无法从 setupPlot 函数外部访问它。将其声明为类的实例变量,您应该可以随时更改其颜色。

    【讨论】:

      猜你喜欢
      • 2012-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-25
      • 2016-09-13
      相关资源
      最近更新 更多