Adding Sounds - Pygame-Menu 4.1.3 Documentation
Adding Sounds - Pygame-Menu 4.1.3 Documentation
Note
You are not reading the most recent version of this documentation. 4.1.4 is the latest
version available.
Adding sounds
A sound engine can be created using the Sound class. The sound engine can be customized
by setting a sound file to several sounds defined by a type.
Example:
import pygame_menu
from pygame_menu import sound
engine = sound.Sound()
engine.set_sound(sound.SOUND_TYPE_CLICK_MOUSE, '/home/me/click.ogg')
engine.set_sound(sound.SOUND_TYPE_OPEN_MENU, '/home/me/open.ogg')
menu = pygame_menu.Menu(...)
menu.set_sound(engine, recursive=True) # Apply on menu and all sub-menus
Type Description
copy() [source]
get_channel() [source]
get_channel_info() [source]
load_example_sounds(volume=0.5) [source]
pause() [source]
play_click_mouse() [source]
play_click_touch() [source]
play_close_menu() [source]
play_error() [source]
play_event() [source]
play_key_add() [source]
play_key_del() [source]
play_open_menu() [source]
play_widget_selection() [source]
Returns: The status of the sound load, True if the sound was loaded
stop() [source]
unpause() [source]
Unpause channel.