How can I play a sound effect to a specific audio device?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By SneakySteve

For example, if I had 4 speakers connected to my PC, and wanted to play an explosion on speaker 1, a chirp on 2, a buzz on 3, and an air current on 4, is there any way to achieve this through the engine? Or do I need to be looking into third-party/external solutions?

:bust_in_silhouette: Reply From: bepis

If you look at the AudioServer API page, they have an example project which allows changing of audio devices.

Here’s the script from that example that does the actual switching.

I know this is an old thread but its one of the first results on google so I thought I’d post an updated answer. I’ve just added the feature in this pull request. Be sure to give it a thumbs up if you’d like to see it added to the next version of Godot.