wav

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	AudioFormat    uint16
	NumChannels    uint16
	SampleRate     uint32
	BytesPerSecond uint32
	BytesPerBlock  uint16
	BitsPerSample  uint16
}

Header is a WAV file header

type LimitReadCloser

type LimitReadCloser struct {
	io.Reader
	// contains filtered or unexported fields
}

LimitReadCloser is a LimitReader that can close

func (*LimitReadCloser) Close

func (lrc *LimitReadCloser) Close() error

Close closes the LimitReadCloser

type Wav

type Wav struct {
	Header
	Samples int
	Reader  io.ReadCloser
}

Wav is a WAV file

func Open

func Open(path string) (*Wav, error)

Open opens and reads the header of a WAV file

func (*Wav) Close

func (w *Wav) Close() error

Close closes the WAV file

func (*Wav) Read

func (w *Wav) Read(n int) ([]float32, error)

Read reads a specific number of samples of the WAV file

func (*Wav) ReadAll

func (w *Wav) ReadAll() ([]float32, error)

ReadAll reads all samples from the WAV file

Jump to

Keyboard shortcuts

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