Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning about 7.1 stereo on set_source_location #2881

Merged

Conversation

Starbuck5
Copy link
Member

For #2751

@Starbuck5 Starbuck5 requested a review from a team as a code owner May 28, 2024 08:00
@Starbuck5 Starbuck5 added docs mixer pygame.mixer labels May 28, 2024
@Starbuck5 Starbuck5 added this to the 2.5.0 milestone May 28, 2024
@MyreMylar
Copy link
Member

MyreMylar commented May 28, 2024

What about testing the available hardware/audio device channels as an advised safety wrapper?

e.g.

num_dev_channels = pygame.mixer.get_init()[2]
if (num_dev_channels  != 8):
     channel.set_source_location(90, 255)

Or we could handle this ourselves in the code for chan_set_source_location() using Mix_QuerySpec() and just skipping positional audio with 8 hardware channels until SDL resolves this?

docs/reST/ref/mixer.rst Outdated Show resolved Hide resolved
docs/reST/ref/mixer.rst Outdated Show resolved Hide resolved
@Starbuck5
Copy link
Member Author

What about testing the available hardware/audio device channels as an advised safety wrapper?

e.g.

num_dev_channels = pygame.mixer.get_init()[2]
if (num_dev_channels  != 8):
     channel.set_source_location(90, 255)

Or we could handle this ourselves in the code for chan_set_source_location() using Mix_QuerySpec() and just skipping positional audio with 8 hardware channels until SDL resolves this?

That isn't a bad idea. I went with my current recommendation because it will (theoretically) keep the source position working. If someone has some crazy fancy setup that supports 7.1 audio, and SDL emulates stereo on top of it, and the source location is set, they should still be able to hear the sound coming from an angle.

I'm hesitant to ignore an exception (or never even try) based on Mix_QuerySpec, since SDL will eventually fix this and then we'll need to remove that code. Also it gives no feedback to the user on why the function isn't working.

Copy link
Member

@MyreMylar MyreMylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK LGTM 👍

Hopefully it gets fixed SDL side at some point and we can un-caveat this function.

docs/reST/ref/mixer.rst Outdated Show resolved Hide resolved
Copy link
Member

@Matiiss Matiiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM of course 👍

@Starbuck5 Starbuck5 force-pushed the set-source-location-warning branch from d5e0f5e to 7a8997b Compare May 30, 2024 06:44
@Starbuck5 Starbuck5 merged commit 2168159 into pygame-community:main May 30, 2024
2 of 3 checks passed
@Starbuck5 Starbuck5 deleted the set-source-location-warning branch May 30, 2024 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs mixer pygame.mixer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants