sound — Pyskool 1.1.1 documentation

### Navigation

- index
- modules |
- next |
- previous |
- Pyskool 1.1.1 documentation »

# 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.

    Parameters: | 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.

    Parameters: | sounds_dir – The path to the sounds directory.

  `unpause`()

    Resume the playing of any sound effect.

`sound.` `ALARM` = 'ALARM'

  ID of the sound effect to play when Albert tells Mr Wacker that Eric is escaping.

`sound.` `ALL_SHIELDS` = 'ALL_SHIELDS'

  ID of the sound effect to play when all the shields have been flashed.

`sound.` `ASYNC` = 2

  Sound effect play mode: asynchronous.

`sound.` `BELL` = 'BELL'

  ID of the sound effect for the bell.

`sound.` `BIKE` = 'BIKE'

  ID of the sound effect to play when the bike is unchained.

`sound.` `CATAPULT` = 'CATAPULT'

  ID of the sound effect to play when Eric’s catapult is fired.

`sound.` `CONKER` = 'CONKER'

  ID of the sound effect to play when Albert is knocked unconscious by the conker.

`sound.` `DESK` = 'DESK'

  ID of the sound effect to play when Eric finds something in a desk.

`sound.` `FROG` = 'FROG'

  ID of the sound effect to play when Eric catches the frog or places it in a cup.

`sound.` `HIT_SOUNDS` = ('HIT0', 'HIT1')

  Hitting sound effect IDs.

`sound.` `JUMP` = 'JUMP'

  ID of the sound effect to play when Eric jumps.

`sound.` `KISS` = 'KISS'

  ID of the sound effect to play when Eric kisses someone.

`sound.` `KNOCKED_OUT` = 'KNOCKED_OUT'

  ID of the sound effect to play when Eric is knocked over.

`sound.` `LINES1` = 'LINES1'

  ID of lines sound effect 1.

`sound.` `LINES2` = 'LINES2'

  ID of lines sound effect 2.

`sound.` `MOUSE` = 'MOUSE'

  ID of the sound effect to play when a mouse is caught.

`sound.` `OPEN_SAFE` = 'OPEN_SAFE'

  ID of the sound effect to play when the safe is opened (with the combination).

`sound.` `SAFE_KEY` = 'SAFE_KEY'

  ID of the sound effect to play when Eric gets the safe key.

`sound.` `SHERRY` = 'SHERRY'

  ID of the sound effect to play when Eric fills the water pistol with sherry.

`sound.` `SHIELD` = 'SHIELD'

  ID of the sound effect to play when a shield is hit.

`sound.` `STOREROOM_KEY` = 'STOREROOM_KEY'

  ID of the sound effect to play when Eric gets the storeroom key.

`sound.` `SUSPEND` = 1

  Sound effect play mode: suspend character movement and screen updates.

`sound.` `TUNE` = 'TUNE'

  ID of the opening tune.

`sound.` `UP_A_YEAR` = 'UP_A_YEAR'

  ID of the sound effect to play when Eric goes up a year.

`sound.` `WALK_SOUNDS` = ('WALK0', 'WALK1', 'WALK2', 'WALK3')

  Walking sound effect IDs.

`sound.` `WATER_PISTOL` = 'WATER_PISTOL'

  ID of the sound effect to play when Eric’s water pistol is fired.

### Navigation

- index
- modules |
- next |
- previous |
- Pyskool 1.1.1 documentation »