boombox.gd¶
Extends: Node
Description¶
Boombox - a singleton audio player framework
Constants Descriptions¶
VOLUME_MAX¶
const VOLUME_MAX: int = 0
The volume to fade to if hte channel should be on
VOLUME_MIN¶
const VOLUME_MIN: int = -80
The volume to fade to if the channel should be off
Property Descriptions¶
ignore_pause¶
var ignore_pause: bool
Let Boombox ignore game pausing. So all sound will continue playing when a game is paused
active_music¶
var active_music: AudioStreamPlayer
The active music player
active_background¶
var active_background: AudioStreamPlayer
The active background player
Method Descriptions¶
reset¶
func reset()
Reset the settings. Stop all music, sounds and backgrounds Used when starting a new game
play_music¶
func play_music(music: AudioStream, from_position: float = 0)
Play a new music file, if it isn’t the current one.
** Parameters**
music: An audiostream of the music to play
pause_music¶
func pause_music()
Pause playing music
resume_music¶
func resume_music()
Resume playing music
stop_music¶
func stop_music()
Stop the currently playing music
get_music¶
func get_music() -> AudioStream
Get the current music
is_music_playing¶
func is_music_playing() -> bool
Get wether boombox is currently playing music
play_background¶
func play_background(background: AudioStream, from_position: float = 0)
Play a background effect
** Parameters **
background: An audiostream of the background noise to play
pause_background¶
func pause_background()
Pause playing background effect
resume_background¶
func resume_background()
Resume playing background effect
stop_background¶
func stop_background()
Stop playing a background effect
get_background¶
func get_background() -> AudioStream
Get the current background
is_background_playing¶
func is_background_playing() -> bool
Get wether boombox is currently playing background
play_effect¶
func play_effect(effect: AudioStream, from_position: float = 0)
Play a sound effect
** Parameters **
effect: An audiostream of the sound effect to play make sure it’s set to “loop = false” in the import settings
pause_effect¶
func pause_effect()
Pause playing the sound effect
resume_effect¶
func resume_effect()
Resume playing the sound effect
stop_effect¶
func stop_effect()
Stop playing a sound a effect
Signals¶
signal effect_finished(): Emited when a sound effect completed playing