audio

package
v0.0.0-...-a4aebfb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CombatLbxPath = "cmbtsnd.lbx"
View Source
const NewSoundLbxPath = "newsound.lbx"
View Source
const SampleRate = 44100
View Source
const SoundLbxPath = "soundfx.lbx"

Variables

Functions

func Initialize

func Initialize()

func IsReady

func IsReady() bool

func LoadCombatSound

func LoadCombatSound(cache *lbx.LbxCache, index int) (*audiolib.Player, error)

func LoadNewSound

func LoadNewSound(cache *lbx.LbxCache, index int) (*audiolib.Player, error)

func LoadSound

func LoadSound(cache *lbx.LbxCache, index int) (*audiolib.Player, error)

func LoadSoundFromLbx

func LoadSoundFromLbx(soundLbx *lbx.LbxFile, index int) (*audiolib.Player, error)

func SaveVoc

func SaveVoc(outputFile io.Writer, soundLbx *lbx.LbxFile, entryIndex int) error

func SaveWav

func SaveWav(outputFile io.Writer, soundLbx *lbx.LbxFile, index int) error

Types

type AudioCache

type AudioCache struct {
	// contains filtered or unexported fields
}

func MakeAudioCache

func MakeAudioCache(cache *lbx.LbxCache) *AudioCache

func (*AudioCache) GetCombatSound

func (cache *AudioCache) GetCombatSound(index int) (*audiolib.Player, error)

func (*AudioCache) GetNewSound

func (cache *AudioCache) GetNewSound(index int) (*audiolib.Player, error)

func (*AudioCache) GetSound

func (cache *AudioCache) GetSound(index int) (*audiolib.Player, error)

type MakePlayerFunc

type MakePlayerFunc func() *audiolib.Player

func GetSoundMaker

func GetSoundMaker(soundLbx *lbx.LbxFile, index int) (MakePlayerFunc, error)

precomputes the resampled sound data so all the client has to do is invoke the returned function. this is useful if you want to play the same sound multiple times

f, err := GetSoundMaker(soundLbx, index)
player, err := f()
player.Play()
 // play again
player, err = f()
player.Play()

func LoadSoundMaker

func LoadSoundMaker(cache *lbx.LbxCache, index int) (MakePlayerFunc, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL