AVAudioEngine playing multi channel audio

前端 未结 2 539
忘掉有多难
忘掉有多难 2020-12-15 14:40

Simple question. How do I play multi channel audio files (>2 channels) using AVAudioEngine so that I can hear all channels on default 2-channel output (headphones/speaker).

2条回答
  •  执念已碎
    2020-12-15 15:26

    I had a similar issue in Swift. The error was 'com.apple.coreaudio.avfaudio', reason: 'required condition is false:!nodeimpl->SslEngineImpl()'.

    The task was to play two audio files, one after another. If I hit stop after playing the first audio file and then played the second audio file, the system crashed.

    I found that in a function I created I had audioEngine.attachNode(audioPlayerNode) which means that the audioPlayerNode was being attached to the audioEngine once and then exited. So I moved this attachment to the viewDidLoad() function so that it gets passed every time.

提交回复
热议问题