Sound class
Sound
that is played in DX Engine.
All sounds require a sound asset id
and need to be fully loaded before they can be played.
Methods
dispose | (self) -> None |
Inherited from Disposable. Disposes this object, effectively turning this into an unmanaged resource. |
|
is_playing | (self) -> bool |
Returns |
|
static | load | (id: str) -> Sound |
Loads a sound via the provided sound |
static | load | (id: str, callback: Callable[[t: Sound], None]) -> Sound |
Loads a sound via the provided sound |
pause | (self) -> None |
Pauses playback of this |
|
play | (self) -> None |
Plays this |
|
play | (self, on_finish: Callable[[], None]) -> None |
Plays this |
|
play | (self, looping: bool) -> None |
Plays this |
|
static | play_one_shot | (sound: Sound, volume: float) -> None |
Plays a oneshot sound based on the provided, loaded |
stop | (self) -> None |
Stops playback of this |
|
static | stop_all | () -> None |
Stops all sounds that are currently playing. |
static | stop_by_id | (sound_ids: Iterable) -> None |
Stops all sounds by their sound asset |
static | stop_by_id | (sound_id: str) -> None |
Stops a sound by its sound asset |
Properties
current_position | float |
Defines the track position of this |
|
readonly | duration | float |
Returns duration of this |
volume | float |
Defines the normalized |