Documentation
¶
Overview ¶
Package wav provides support for the WAV file format.
Supported formats are PCM 8- and 16-bit, and IEEE float. Extended chunks (JUNK, bext, and others added by tools like ProTools) are ignored.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct {
AudioFormat uint16
NumChannels uint16
SampleRate uint32
ByteRate uint32
BlockAlign uint16
BitsPerSample uint16
}
Header contains Wav fmt chunk data.
type Wav ¶
type Wav struct {
Header
// Samples is the total number of available samples.
Samples int
// Duration is the estimated duration based on reported samples.
Duration time.Duration
// contains filtered or unexported fields
}
Wav reads wav files.
func (*Wav) ReadFloats ¶
ReadFloats is like ReadSamples, but it converts any underlying data to a float32.
func (*Wav) ReadSamples ¶
ReadSamples returns a [n]T, where T is uint8, int16, or float32, based on the wav data. n is the number of samples to return.
Click to show internal directories.
Click to hide internal directories.