I'm trying to play positional sound effects in Godot 3.1 in Linux Mint using pulse audio, and I've been having trouble with glitches in my short sounds (imported from wav) when changing the position of the AudioStream3D node and volume (using either set_max_db or set_unit_db, it's not clear which should be used) immediately prior to playing the sound.
I was originally using is_playing() on the audiostream to determine whether a previous sound was finished before playing the next, however this didn't work reliably in my tests so I've also tested using in addition a manual timer for each AudioStream, to prevent playing again until after a delay for the length of the sound + a bit extra. The problem persists.
I've tried an original approach of using a pool of AudioStreams and moving their translation at the point of playing the sound, and also simply attaching AudioStreams to moving objects in the game. The AudioStreams attached to moving objects don't seem to suffer from glitches from changing translation as this is not necessary, but do glitch from changing the volume of the sound each play.
I've tried it using AudioStream2D and AudioStream3D, both have same problem. I've also tried exporting the project to linux and exporting to windows and running under wine, same problem. Unfortunately I don't have a windows machine to test, but will make an example test project if this a bug.
Am I using Godot in the expected manner to play sounds? I would like to check this before adding as a bug to the issue tracker, maybe I am making an obvious mistake.
This is an audio capture showing an example glitch, a sine wave test sound is being interrupted / glitched after 0.05 second (bottom left) even though the sound should last a second or so.
I suspect there is some issue with the changes to the volume and position being applied out of order compared to the order in which they were issued to godot.