Sound
type Sound
Sound is a playing sound. yield s waits until it ends; a nil or finished sound is done. It is a presentation event: wait for game logic with a timer, not a sound.
Sound.Done method
func (Sound) Done() bool
Reports whether the sound ended, was stopped or is nil.
Sound.Pause method
func (Sound) Pause()
Holds the sound where it is.
Sound.Playing method
func (Sound) Playing() bool
Reports whether the sound is audible now: not done, not stopping and not paused.
Sound.Position method
func (Sound) Position() float
Returns the seconds played, within the loop for a looping sound.
Sound.Resume method
func (Sound) Resume()
Continues a paused sound.
Sound.SetPan method
func (Sound) SetPan(pan float)
Pans a sound that is not spatial, -1 to 1.
Sound.SetPitch method
func (Sound) SetPitch(pitch float)
Changes speed and pitch, 0.25 to 4.
Sound.SetVolume method
func (Sound) SetVolume(volume float)
Changes the volume with a short ramp.
Sound.Stop method
func (Sound) Stop()
Ends the sound with a short fade.
Sound.StopFade method
func (Sound) StopFade(seconds float)
Fades the sound out over seconds.
Sound.Completed signal
signal Completed(finished bool)
Runs once when the sound ends: finished is false after Stop, when it was cut off, or when its node died.