Sound Effects

Sound effects can be triggered by sending an event:

def on_button_pressed(self, event, signal):

Both Ogg/Vorbis and WAV are supported audio formats.


As is usual with assets, you should instantiate your ppb.Sound as soon as possible, such as at the class level.


PyGame has fairly limited codec support. “Complex WAVE files” are not supported. Ogg/Opus appears to be unsupported. Additional formats and codecs might be supported but undocumented.


class ppb.assets.Asset)[source]

Fire to start a sound playing.

class ppb.Sound(name)[source]

The asset to use for sounds. WAV and Ogg/Vorbis are supported.