Documentation ¶
Overview ¶
Package d2audio provides AudioProvider implementations
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sound ¶
A Sound that can be started and stopped
type SoundEngine ¶
SoundEngine provides functions for playing sounds
func NewSoundEngine ¶
func NewSoundEngine(provider d2interface.AudioProvider, asset *d2asset.AssetManager, l d2util.LogLevel, term d2interface.Terminal) *SoundEngine
NewSoundEngine creates a new sound engine
func (*SoundEngine) Advance ¶
func (s *SoundEngine) Advance(elapsed float64)
Advance updates sound engine state, triggering events and envelopes
func (*SoundEngine) PlaySoundHandle ¶
func (s *SoundEngine) PlaySoundHandle(handle string) *Sound
PlaySoundHandle plays a sound by sounds.txt handle
func (*SoundEngine) PlaySoundID ¶
func (s *SoundEngine) PlaySoundID(id int) *Sound
PlaySoundID plays a sound by sounds.txt index, returning the sound here is kinda ugly now we could have a situation where someone holds onto the sound after the sound engine is done with it someone needs to be in charge of deciding when to stopping looping sounds though...
func (*SoundEngine) UnbindTerminalCommands ¶
func (s *SoundEngine) UnbindTerminalCommands(term d2interface.Terminal) error
UnbindTerminalCommands unbinds commands from the terminal
type SoundEnvironment ¶
type SoundEnvironment struct {
// contains filtered or unexported fields
}
SoundEnvironment represents the audio environment for map areas
func NewSoundEnvironment ¶
func NewSoundEnvironment(soundEngine *SoundEngine) SoundEnvironment
NewSoundEnvironment creates a SoundEnvironment using the given SoundEngine
func (*SoundEnvironment) Advance ¶
func (s *SoundEnvironment) Advance(elapsed float64)
Advance advances the sound engine and plays sounds when necessary
func (*SoundEnvironment) SetEnv ¶
func (s *SoundEnvironment) SetEnv(environmentIdx int)
SetEnv sets the sound environment using the given record index