diff --git a/buildconfig/stubs/gen_stubs.py b/buildconfig/stubs/gen_stubs.py index a762693f41..da679ac8f8 100644 --- a/buildconfig/stubs/gen_stubs.py +++ b/buildconfig/stubs/gen_stubs.py @@ -68,7 +68,7 @@ "_debug": ["print_debug_info"], "event": ["Event"], "font": ["Font"], - "mixer": ["Channel"], + "mixer": ["Sound", "Channel"], "time": ["Clock"], "joystick": ["Joystick"], "window": ["Window"], diff --git a/buildconfig/stubs/pygame/__init__.pyi b/buildconfig/stubs/pygame/__init__.pyi index 00690f3737..a8ecdd7f25 100644 --- a/buildconfig/stubs/pygame/__init__.pyi +++ b/buildconfig/stubs/pygame/__init__.pyi @@ -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 diff --git a/docs/reST/ref/mixer.rst b/docs/reST/ref/mixer.rst index 3de038983d..d23e2aa60a 100644 --- a/docs/reST/ref/mixer.rst +++ b/docs/reST/ref/mixer.rst @@ -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` diff --git a/src_py/__init__.py b/src_py/__init__.py index ac29abd3c8..bce9fe3ebb 100644 --- a/src_py/__init__.py +++ b/src_py/__init__.py @@ -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)