Documentation
¶
Index ¶
Constants ¶
View Source
const SampleRate = 44100
Variables ¶
View Source
var Context = audio.NewContext(SampleRate)
Functions ¶
This section is empty.
Types ¶
type MusicPlayer ¶ added in v0.3.1
func NewMusicPlayer ¶ added in v0.3.1
func NewMusicPlayer(fsys fs.FS, name string) (MusicPlayer, error)
func (MusicPlayer) Close ¶ added in v0.3.1
func (p MusicPlayer) Close()
type Sound ¶ added in v0.3.1
type Sound []byte
type SoundBag ¶ added in v0.3.1
type SoundBag []Sound
SoundBag is for playing one of effects in the slice. Useful for playing slightly different effect when doing same actions.
func NewSoundBag ¶ added in v0.3.1
Todo: remove redundancy with NewImages()?
type SoundPlayer ¶ added in v0.3.1
A player for sample sound is generated at a place.
func NewSoundPlayer ¶ added in v0.3.1
func NewSoundPlayer(fsys fs.FS, vol *float64) (s SoundPlayer)
Todo: need a test
func (SoundPlayer) Play ¶ added in v0.3.1
func (s SoundPlayer) Play(name string, vol2 float64)
Click to show internal directories.
Click to hide internal directories.