The sound module contains functions for playing simple sound effects on iOS.
Play the sound effect with the given name. You can access a list of built-in sound effect names using the asset picker ([+] button in the toolbar), but name can also be a file path if you want to use your own sound effects.
Playback is asynchronous, i.e. the function returns before the sound has finished playing. The return value is an opaque identifier that can be used with the stop_effect() function. The volume and pitch arguments are optional, by default, the effect is played with the global volume, as set by set_volume().
Stops playback of a sound effect. The effect_id is the return value of play_effect().
Sets the default volume for all sound effects (between 0.0 and 1.0, the default is 0.5).
Determines whether the silent (mute) switch is honored when playing sounds (True by default).
The Player class provides an easy-to-use interface for playing audio files from disk. Using this class is recommended for music and other audio that doesn’t require very low latency. For sound effects in games, play_effect() is more suitable.
Start playing audio.
Stop playing audio and reset the playback position.
Stop playing audio, but keep the current playback position.
The duration of the loaded audio track in seconds (read-only).
The current playback position in seconds.
The duration of the audio track (read-only).
The number of times the audio track should be repeated. Set to -1 to repeat forever.