Documentation ¶
Overview ¶
Package sound manages music and sound effects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // If enabled is false, all sound functions are no-ops. Enabled bool // Root folder on disk where sound and music files should live. SoundRoot = filepath.Join("rtp", "sfx") MusicRoot = filepath.Join("rtp", "music") )
Package globals.
Functions ¶
func LoadMusic ¶
LoadMusic loads filename from the MusicRoot into the global music cache. If the music is already loaded, does nothing.
func LoadSound ¶
LoadSound loads filename from the SoundRoot into the global SFX cache. If the sound is already loaded, does nothing.
func PlaySound ¶
func PlaySound(filename string)
PlaySound plays the named sound. It will de-duplicate if the same sound is already playing.
func PreloadAll ¶
func PreloadAll()
PreloadAll looks in the SoundRoot and MusicRoot folders and preloads all supported files into the caches.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.