应用过滤器后保存/分析输出

Save / Analyze output after applying a filter

我正在尝试分析音频文件的振幅数据,但我似乎无法在应用过滤器后找到获取此数据的方法。是否可以获取floatChannelData或将输出写入新文件进行分析?

    player = AKPlayer(audioFile: file)
    player.buffering = .always
    player.preroll()
    let filter = AKBandPassButterworthFilter(player, centerFrequency: 1000, bandwidth: 100)
    AudioKit.output = filter

    do {
        try AudioKit.start()
    } catch {
        print("Failed to start AudioKit")
        return nil
    }

    // This is the peak as though no filter was applied
    print(player.buffer?.peak())

是的,您可以选择将输出渲染到文件。您还可以点击过滤器节点以获取其数据以用于绘图,或将内容保存到缓冲区并将数据保存到 AudioKit 的渲染之外。