PixelPAD 2D - sounds

new_sound(name: str) -> sound

Example
Description
Loads a sound asset.
Parameters
name
The name of the sound asset to load as a string. Also accepts URI

Return
A sound which can be played.

play_sound(snd: sound) -> None

Example
Description
Plays a sound.
Parameters
snd
The sound to play

Return
No return value.

loop_sound(snd: sound) -> None

Example
Description
Toggle whether a sound will loop when it finishes playing.
Parameters
snd
The sound to loop.

Return
No return value.

stop_sound(snd: sound) -> None

Example
Description
Stops a currently playing sound. If the sound is started again, it will replay from the beginning.
Parameters
snd
The sound to stop playing.

Return
No return value.

set_volume(snd: sound, volume: float) -> None

Example
Description
Change the volume of the sound mixer.
Parameters
volume
The volume to set the mixer to. Muted is 0, maximum is 1.

Return
No return value.

Sounds

PixelPAD2D supports the usage of sound! Using sound is similar to setting up sprites however is slightly different. The way PixelPAD2D sound works is you load an audio file from assets into a variable, then play it. You can also set it to loop or end it early.
Company
Resources
Contact Us