doodle/pkg/sound/sound_wasm.go
Noah Petherbridge 6d8aa387d7 WIP Game Settings Window, WASM Fixes, Sound FX
* Add sound effect and music support to Doodle.
* Fix WASM build to use the 'null' sound driver for now.
* Add a Settings button to the main menu; UI for it is WIP.
2020-09-01 20:54:58 -07:00

33 lines
677 B
Go

//+build js,wasm
package sound
import (
"git.kirsle.net/go/audio"
"git.kirsle.net/go/audio/null"
)
// Globals for WASM sound engine.
var (
engine *null.Engine
)
func init() {
engine = null.New()
}
// LoadMusic loads filename from the MusicRoot into the global music cache.
// If the music is already loaded, does nothing.
func LoadMusic(filename string) audio.Playable {
return null.Playable{}
}
// LoadSound loads filename from the SoundRoot into the global SFX cache.
// If the sound is already loaded, does nothing.
func LoadSound(filename string) audio.Playable {
return null.Playable{}
}
// PlaySound plays the named sound.
func PlaySound(filename string) {}