Skip to content

package audio_system

import "kaiju/audio/audio_system"

Functions

Init

func Init() error

Pcm2Float

func Pcm2Float(wav *Wav) []byte

PlayWav

func PlayWav(wav *Wav)

Quit

func Quit()

Rechannel

func Rechannel(w *Wav, channels int16) []byte

Resample

func Resample(w *Wav, sampleRate int32) []byte

Types

Wav

struct

type Wav struct {
    WavData []byte // Data at top because we need to align on 64-bit

    FormatType WavFormat
    Channels   int16
    SampleRate int32

    // Has unexported fields.
}

LoadWav

func LoadWav(assetDatabase *assets.Database, wavFile string) (*Wav, error)

WavFormat

int16

type WavFormat = int16

const ( WavFormatPcm WavFormat = 1 WavFormatFloat WavFormat = 3 )