audio

package
v0.0.0-...-edd59cf Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const SampleRate = 44100

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 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