小编Dae*_*lus的帖子

将 AVAudioMixerNode 连接到 AVAudioEngine

我使用 AVAudioMixerNode 来更改音频格式。这篇文章对我帮助很大。下面的代码给了我我想要的数据。但我在电话扬声器中听到了自己的声音。我该如何预防?

func startAudioEngine()
{
    engine = AVAudioEngine()

    guard let engine = engine, let input = engine.inputNode else {
        // @TODO: error out
        return
    }

    let downMixer = AVAudioMixerNode()
    //I think you the engine's I/O nodes are already attached to itself by default, so we attach only the downMixer here:
    engine.attach(downMixer)

    //You can tap the downMixer to intercept the audio and do something with it:
    downMixer.installTap(onBus: 0, bufferSize: 2048, format: downMixer.outputFormat(forBus: 0), block:  //originally 1024
        { (buffer: …
Run Code Online (Sandbox Code Playgroud)

pcm ios swift avaudioengine

5
推荐指数
1
解决办法
2053
查看次数

标签 统计

avaudioengine ×1

ios ×1

pcm ×1

swift ×1