seika.audio
Audio
Interface for music and sound effects. Music will continue to loop until stopped and sound is only played once. Will be deprecated in place of AudioStream
Properties
None.
Signals
None.
Methods
@staticmethod
play_music(music_id: str, loops=True) -> None:
Plays music, will loop is loops
is set to True
.
@staticmethod
stop_music() -> None:
Stops currently playing music.
@staticmethod
set_music_volume(volume: int) -> None:
Sets volume for music.
@staticmethod
play_sound(sound_id: str) -> None:
Plays a sound.
@staticmethod
set_sounds_volume(volume: int) -> None:
Sets volume for sounds.
@staticmethod
set_all_volume(volume: int) -> None:
Sets volume for all audio.
AudioStream
Interface for audio. Should be used instead of Audio but care must be taken to zero out the amplitude at the end of samples especially when looping.
Properties
uid: str
Unique identifier for AudioStream.
pitch: float
The pitch for the AudioStream, initializes to 1.0 by default. (Min: 0.0, Max: 1.0)
gain: float
The gain (volume) for the AudioStream, initializes to 1.0 by default. (Min: 0.0, Max: 1.0)
loops: bool
Determines if the AudioStream will play the sample from the beginning when reaching the end. Defaults to False
.
is_playing: bool
Returns whether the audio stream is playing or not.
Signals
None.
Methods
@staticmethod
get(uid: str) -> seika.audio.AudioStream:
Return a reference to a loaded AudioStream
object.
play() -> None:
Plays the audio loaded into AudioStream
.
stop() -> None:
Stops the audio loaded into AudioStream
.