-
-
Notifications
You must be signed in to change notification settings - Fork 164
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 mixer.get_driver
#2741
Add mixer.get_driver
#2741
Conversation
b8282d5
to
ca584d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems legit, looks good
- API isn't changing in SDL3 ✔️ (well, the SDL_AUDIODRIVER env is moving to SDL_AUDIO_DRIVER, but we can put in a note for that)
- API doesn't already exist in _sdl2.audio ✔️
- Test passes locally ✔️
- Exhaustive list of drivers checks out against a skim of source code ✔️
Should get SDL_GetAudioDriver
and SDL_GetNumAudioDrivers
be ported too, into a method to get a list of available drivers? That way a user setting SDL_AUDIODRIVER could see what the options are.
It seems like this would help test #2733 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Tested with:
import pygame
pygame.init()
print(pygame.mixer.get_driver())
>> wasapi
Sounds like a good idea. We could also give display the same treatment. Maybe we could export this as a list, instead of having to export two separate functions. |
That's what I had in mind. |
While working on #2733 I realised that we don't actually have the
mixer
analogue todisplay.get_driver()
. This PR addsmixer.get_driver
to find out the current audio driver being used.