wave

package
v0.0.0-...-ea4d24e Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RIFFMainChunkSize = 12     // The size of the main RIFF chunk, at the beginning of the file.
	RIFFHeader        = "RIFF" // The "Chunk ID" in the main RIFF chunk.
	RIFFFormat        = "WAVE" // The "Format" in the main RIFF chunk.
	WaveHeader        = "fmt " // The "Subchunk ID" in the "fmt" subchunk.
	WaveFormatPCM     = 1      // The "Audio Format" in the "fmt " subchunk we want, namely PCM.
	DataHeader        = "data" // The "Subchunk ID" in the "data" subchunk.
)

Variables

This section is empty.

Functions

func SoundFileCheckWave

func SoundFileCheckWave(file io.ReadSeeker) (ok bool)

SoundFileCheckWave checks if a given file is in RIFF/WAVE audio format.

It only checks the "RIFF" and "WAVE" magics in the main RIFF chunk, i.e., it only tells if the file is definitely not in another format.

Types

type SoundFileReaderWave

type SoundFileReaderWave struct {
	// contains filtered or unexported fields
}

SoundFileReaderWave is a decoder for the RIFF/WAVE audio format.

func (*SoundFileReaderWave) Close

func (r *SoundFileReaderWave) Close() error

func (*SoundFileReaderWave) Info

func (*SoundFileReaderWave) Open

func (r *SoundFileReaderWave) Open(file io.ReadSeeker) (info audio.SoundFileInfo, err error)

func (*SoundFileReaderWave) Read

func (r *SoundFileReaderWave) Read(data []int16) (samplesRead int64, err error)

func (*SoundFileReaderWave) Seek

func (r *SoundFileReaderWave) Seek(sampleOffset int64) error

Jump to

Keyboard shortcuts

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