Skip to content

Proposal: Implement _sdl2.audio in C inside pygame.mixer with a few edits #3440

Open
@damusss

Description

@damusss

As we move towards pygame 3 we should de-experimentalize modules, deal with deprecations and deal with the _sdl2 submodule. I checked _sdl2.audio and noticed the only thing it exports is an interface to get information about the audio devices.
Does this need its own module?
Yes, SDL_mixer and SDL_audio are different things, but do users care? I mean, audio device info is already very niche, its own module sounds like too much.
I propose to convert that cython extension to C and add it as pygame.mixer.AudioDevice (alongside the function that that module exports).
While porting it, it would also be ported as SDL3 compatible (even if mixer isn't at the moment).
Also, I think that the port should not be a copy and paste. The naming conventions of that class are atrocious. For example, "devicename" or "deviceid". The class is literally called "AudioDevice". it's like having pygame.Surface.surface_size... The names also need snake case, not the current one.
Porting it would add quite the number of constants, so I really need your opinion (especially the steering council). In C it would be added as an audio.c that is later #included not to clutter mixer.c.
I didn't code anything yet, this is brainstorming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    New APIThis pull request may need extra debate as it adds a new class or function to pygame_sdl2pygame._sdl2discussionenhancementmixerpygame.mixer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions