pygame-community / pygame-ce

🐍🎮 pygame - Community Edition is a FOSS Python library for multimedia applications (like games). Built on top of the excellent SDL library.
https://pyga.me
777 stars 123 forks source link

Add `mixer.get_driver` #2741

Closed ankith26 closed 4 months ago

ankith26 commented 4 months ago

While working on #2733 I realised that we don't actually have the mixer analogue to display.get_driver(). This PR adds mixer.get_driver to find out the current audio driver being used.

Starbuck5 commented 4 months ago

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

ankith26 commented 3 months ago

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.

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.

Starbuck5 commented 3 months ago

That's what I had in mind.