AudioStreamPlayer3D: Correct amplitude panning #103856
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The effective number of speakers was being calculated on uninitialized parameters. It worked by chance for 2 channels, but it fails for more channels.
Before this change the front/center speakers would have less volume and the side speakers would be unbalanced.
I don't have a multiple speaker setup, so my testing is limited to hearing only two channels at a time.
Effective number of speakers calculation for 7.1 before this PR:
channel 0: 4.000000 (front left)
channel 1: 4.000000 ( front right)
channel 2: 4.707107 (center)
channel 3: 3.146447 (rear left)
channel 4: 3.146446 (rear right)
channel 5: 4.000000 (side left)
channel 6: 3.500000 (side right)
And after:
channel 0: 3.853553 (front left)
channel 1: 3.853553 (front right)
channel 2: 4.000000 (center)
channel 3: 3.146447 (rear left)
channel 4: 3.146446 (rear right)
channel 5: 3.500000 (side left)
channel 6: 3.500000 (side right)