I found this handy function in Unreal’s documentation which should do precisely what I need - to change output device for audio in built project.
I’m fairly new to cpp, so I’ll try to explain how I understand it.
It is a public function of “abstract interface” IAudioMixerPlatformInterface
, and I’ve also found it in AudioMixerPlatformXAudio2.h as a public function of child class class FMixerPlatformXAudio2 : public IAudioMixerPlatformInterface
The project I’m working on is for Windows platform only at this point.
I’m having trouble figuring out how to call this function from my BPFunctionLibrary.
I think it’s something like
Audio::IAudioMixerPlatformInterface::MoveAudioStreamToNewAudioDevice(pMyNewDeviceID);
…but probably not. So…
- I need to get system audio devices IDs
- Then do I have to create new
IAudioMixerPlatrformInterface
, or can I just somehow get existing MixerInterface likeFMixerPlatformXAudio2
and call this function from it?
Or is there a different way to change output audio device after build (not necessarily at runtime)?