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 alias pygame.Sound #3063

Merged
merged 6 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildconfig/stubs/gen_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"_debug": ["print_debug_info"],
"event": ["Event"],
"font": ["Font"],
"mixer": ["Channel"],
"mixer": ["Sound", "Channel"],
"time": ["Clock"],
"joystick": ["Joystick"],
"window": ["Window"],
Expand Down
2 changes: 1 addition & 1 deletion buildconfig/stubs/pygame/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ from .mask import Mask as Mask
from ._debug import print_debug_info as print_debug_info
from .event import Event as Event
from .font import Font as Font
from .mixer import Channel as Channel
from .mixer import Sound as Sound, Channel as Channel
from .time import Clock as Clock
from .joystick import Joystick as Joystick
from .window import Window as Window
Expand Down
3 changes: 3 additions & 0 deletions docs/reST/ref/mixer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ The following file formats are supported
:class:`pygame.mixer.Sound` keyword arguments and array interface support
.. versionaddedold:: 2.0.1 pathlib.Path support on Python 3.

.. versionchanged:: 2.5.2 This class is also available through the ``pygame.Sound``
alias.

.. method:: play

| :sl:`begin sound playback`
Expand Down
1 change: 1 addition & 0 deletions src_py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ def PixelArray(surface): # pylint: disable=unused-argument

try:
import pygame.mixer
from pygame.mixer import Sound
from pygame.mixer import Channel
except (ImportError, OSError):
mixer = MissingModule("mixer", urgent=0)
Expand Down
Loading