Skip to content

Commit

Permalink
Merge pull request #311 from ppizarror/macos-notimplemented-mixer
Browse files Browse the repository at this point in the history
Fix sound notimplemented
  • Loading branch information
ppizarror authored Mar 22, 2021
2 parents 1a3389c + 5193ee1 commit 223ffd0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ https://pygame-menu.readthedocs.io
Install Instructions
--------------------

Pygame-menu can be installed via pip. Simply run::
Pygame-menu can be installed via pip. Simply run:

.. code-block:: bash
$> pip install pygame-menu
Expand Down
1 change: 1 addition & 0 deletions pygame_menu/baseimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def __init__(

# Load the image and store as a surface
if load_from_file:
# pygame.image.get_extended()
self._surface = pygame.image.load(image_path)
self._original_surface = self._surface.copy()

Expand Down
7 changes: 7 additions & 0 deletions pygame_menu/sound.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,13 @@ def set_sound(
)
self._sound[sound_type] = {}
return False
except NotImplementedError:
warn(
'mixer module is not available on the current System, thus, the '
'sound file "{0}" could not be loaded'.format(sound_file)
)
self._sound[sound_type] = {}
return False

# Configure the sound
sound_data.set_volume(float(volume))
Expand Down

0 comments on commit 223ffd0

Please sign in to comment.