TwitchTTS icon indicating copy to clipboard operation
TwitchTTS copied to clipboard

Respect Windows application-level output device settings in Speak()

Open PaletzTheWise opened this issue 3 years ago • 0 comments

Hello, I ran into the issue that Windows application-level output device setting is not respected. My use case is to send TTS to a different device than the system default and Windows 10 actually lets you configure individual application output/input devices (Open Sound Settings -> "App volume and device preferences" under Advanced sound options). SetOutputToDefaultAudioDevice() apparently ignores this configuration. I have also noticed that the GetDefaultAudioEndpoint() will fetch system-wide default until the application actually plays some sound. It may be related to the fact that the Windows configuration page does not list the application until then, although it does remember the setting even if you turn the app off and on again.

Anyways, my fix feels hacky and I have never seen these APIs before, so take it with a grain of salt. Dunno if Speak_gcp() needs the same fix or if it maybe is a better example of how the API should be used.

PaletzTheWise avatar May 01 '22 01:05 PaletzTheWise