Search code examples
audiomicrosoft-metroxaudio2

how do i set output of submix voice in XAudio2? (metro)


I tried using the SetOutputVoices function, and the constructor parameter, but both result in a XAUDIO2_E_INVALID_CALL as the result when used on a submix voice.

the docs say that you get that error by calling it from an audio callback, but i'm not. i have even tried calling it before starting the audio engine.

the same method works for source voices, so i'm pretty sure i'm not passing a bad XAUDIO2_VOICE_SENDS structure.


Solution

  • Submix voices have a processing order, specified by the processingStage parameter in IXaudio2.CreateSubmixVoice

    You can only send output to a submix voice with a lower processing stage. and i had all of my submixes at the default processing stage (0).