Godot Version
4.3 Mono
Question
I need to work with surround sound in Godot but and it is very unclear to me exactly how this works. Could somebody explain it to me?
I will demonstrate my fragmented understanding to demonstrate my understanding/lack of understanding. This may help improve the documentation in the future.
What I think I understand:
- AudioStreamPlayer3D nodes are positioned in space relative to an AudioListener3D.
- The AudioListener3D node calculates what it should hear according to the AudioStreamPlayer3D configuration.
- We can direct audio to buses (including non-positional audio).
- We can use panning to control which speakers audio goes to in the bus.
Questions:
- Where exactly does the AudioListener3D audio output to?
- How does the AudioListener convert to 5.1 audio and how is this selected?
- How does panning in busses relate to the 5.1 output? Isn’t this all calcualted by the AudioListener3D? Can it pan beyond stereo sound?
- I see AudioServer has a get speaker mode so I suppose I have to select a driver that supports surround sound?
- So is the speaker configuration external to Godot?
Thank you.
the AudioListener3D does not output audio. It is used to override the location sounds are heard from. The output bus is configured in the AudioStreamPlayer3D.
The speaker configuration / driver is external to Godot, and depends on the hardware/OS. So you cannot “change it”.
If you want 5.1 audio you need to provide 5.1 tracks. Godot cannot “convert” stereo to 5.1
1 Like
I would assume OP’s question is whether/how AudioStreamPlayer3D
does positional audio. If you have a 5.1 system, will AudioStreamPlayer3D
let you play a sound “behind” the player?
1 Like
Yes, that is what I’m getting at. We can output 5.1 and 7.1 configurations with Godot and I just assumed there was some mapping/mixing to 5.1 available with positional audio in the same way that the standard 2.0 (stereo) configuration works.
I’m assuming that there is an art to doing this well and some conventions e.g. front soundbar for voices. However, surely 4 of the 5 tracks (the quad speaker part) would just arrange audio in a circle around a listener with positional audio? I’m then assuming the subwoofer is just some mono output with a low pass filter which a soundcard could do automatically.
Perhaps Godot just transmits whatever is neccesary to the sound card for spatialised audio somewhere in the background (I don’t have the setup yet to try). I hoped there would be some control over this within Godot itself though I understand they’d like to keep it as simple as possible.
Test it in stereo (proper stereo sound does 3d positional just fine) and it’ll also work in 2+ sound channels setup.
Then when that works good in stereo, you can think of supporting more channels explicitly.
A lot of people play just with headphones…
1 Like