wave

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatPCM        = 0x0001
	FormatIEEEFloat  = 0x0003
	FormatALaw       = 0x0006
	FormatMuLaw      = 0x0007
	FormatExtensible = 0xfffe
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Wave

type Wave struct {
	Fmt    *WaveFmt
	Fact   *WaveFact
	Frames [][]float64
}

func ReadWaveFromFile

func ReadWaveFromFile(f string, headerOnly bool) (*Wave, error)

func ReadWaveFromReader

func ReadWaveFromReader(reader io.Reader, headerOnly bool) (*Wave, error)

type WaveFact

type WaveFact struct {
	SampleLength int
}

type WaveFmt

type WaveFmt struct {
	AudioFormat    int    // PCM = 1 (Linear Quantization), if not 1, compression was used.
	NumChannels    int    // Mono 1, Stereo = 2, ..
	SampleRate     int    // 44100 for CD-Quality, etc..
	ByteRate       int    // SampleRate * NumChannels * BitsPerSample / 8
	BlockAlign     int    // NumChannels * BitsPerSample / 8 (number of bytes per sample)
	BitsPerSample  int    // 8 bits = 8, 16 bits = 16, .. :-)
	ExtraParamSize int    // if not PCM, can contain extra params
	ExtraParams    []byte // the actual extra params.
}

Jump to

Keyboard shortcuts

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