sound

Play sound effects.

class sound.Beeper(sounds_dir, config)

The maker of sound effects.

Parameters:
  • sounds_dir – The path to the sounds directory.
  • config (dict) – Configuration parameters from the ini file.
add_sound(sound_id, sound_file)

Add a sound effect to the beeper’s collection.

Parameters:
  • sound_id – The ID of the sound effect.
  • sound_file – The file name of the sound effect (relative to the sounds directory).
is_busy()
Return whether a sound effect is being played at the moment in SUSPEND mode.
make_sitting_sound(mode)

Play a sitting sound effect. This will be a walking sound effect, chosen at random from those available.

Parameter:mode – The mode in which to play the sound effect (see play()).
make_walking_sound(index, mode)

Play a walking sound effect.

Parameters:
  • index – The index of the walking sound effect.
  • mode – The mode in which to play the sound effect (see play()).
pause()
Pause the playing of any sound effect.
play(sound_id, mode=1)

Play a sound effect.

Parameters:
  • sound_id – The ID of the sound effect.
  • mode – If SUSPEND, movement of characters and screen updates are suspended until the sound effect has finished playing, but the quit and pause keys will be checked in the meantime; if ASYNC (or anything else), the sound effect will play asynchronously.
restore(sounds_dir)

Perform tasks required immediately after loading a saved game.

Parameter:sounds_dir – The path to the sounds directory.
unpause()
Resume the playing of any sound effect.
sound.ALL_SHIELDS
ID of the sound effect to play when all the shields have been flashed.
sound.ASYNC
Sound effect play mode: asynchronous.
sound.BELL
ID of the sound effect for the bell.
sound.BIKE
ID of the sound effect to play when the bike is unchained.
sound.CATAPULT
ID of the sound effect to play when Eric’s catapult is fired.
sound.CONKER
ID of the sound effect to play when Albert is knocked unconscious by the conker.
sound.DESK
ID of the sound effect to play when Eric finds something in a desk.
sound.FROG
ID of the sound effect to play when Eric catches the frog or places it in a cup.
sound.JUMP
ID of the sound effect to play when Eric jumps.
sound.KISS
ID of the sound effect to play when Eric kisses someone.
sound.KNOCKED_OUT
ID of the sound effect to play when Eric is knocked over.
sound.LINES1
ID of lines sound effect 1.
sound.LINES2
ID of lines sound effect 2.
sound.MOUSE
ID of the sound effect to play when a mouse is caught.
sound.OPEN_SAFE
ID of the sound effect to play when the safe is opened (with the combination).
sound.SAFE_KEY
ID of the sound effect to play when Eric gets the safe key.
sound.SHERRY
ID of the sound effect to play when Eric fills the water pistol with sherry.
sound.SHIELD
ID of the sound effect to play when a shield is hit.
sound.STOREROOM_KEY
ID of the sound effect to play when Eric gets the storeroom key.
sound.SUSPEND
Sound effect play mode: suspend character movement and screen updates.
sound.TUNE
ID of the opening tune.
sound.UP_A_YEAR
ID of the sound effect to play when Eric goes up a year.
sound.WALK_SOUNDS
Walking sound effect IDs.
sound.WATER_PISTOL
ID of the sound effect to play when Eric’s water pistol is fired.

Previous topic

skool

Next topic

staircase