Documentation
¶
Overview ¶
Package sdl implements an audio engine using libSDL2.
Index ¶
- type Engine
- func (e *Engine) LoadMusic(filename string) (Track, error)
- func (e *Engine) LoadMusicBin(data []byte) (Track, error)
- func (e *Engine) LoadSound(filename string) (Track, error)
- func (e *Engine) LoadSoundBin(data []byte) (Track, error)
- func (e *Engine) Playing() bool
- func (e *Engine) PlayingMusic() bool
- func (e *Engine) PlayingSound() bool
- func (e *Engine) Setup() error
- func (e *Engine) StopAll()
- func (e *Engine) StopMusic()
- func (e *Engine) StopSounds()
- func (e *Engine) Teardown() error
- type Track
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the SDL2 audio engine.
func New ¶
New initializes an SDL2 Mixer for the audio engine.
Pass the SDL2 Mixer flags for its initialization. The flags are an OR'd value made up of:
mix.INIT_MP3 mix.INIT_OGG mix.INIT_FLAC mix.INIT_MOD
func (*Engine) LoadMusicBin ¶
LoadMusicBin loads a music file from bytes data.
func (*Engine) LoadSoundBin ¶
LoadSoundBin loads a wave file from bytes data.
func (*Engine) PlayingMusic ¶
PlayingMusic returns if music is currently playing.
func (*Engine) PlayingSound ¶
PlayingSound returns if sounds are playing.
Click to show internal directories.
Click to hide internal directories.