Sound.play_one_shot method

play_one_shot(sound: Sound, volume: float) -> None:

Plays a oneshot sound based on the provided, loaded Sound.

Oneshot sounds can be played multiple times from the same Sound source and are useful for repeating sound effects like rain and foot steps.

Parameters

  • sound: Sound

    sound to play once.

  • volume: float

    normalized volume at which to play the sound.