wav

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package wav provides functionality to handle .wav files and .wav encoded data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(r io.Reader) (audio.Audio, error)

Load loads wav data from the incoming reader as an audio

func ReadFormat added in v3.4.0

func ReadFormat(r io.Reader) (audio.Format, error)

Read reads a WAV header from the provided reader, returning the PCM format and leaving the PCM data in the reader available for consumption.

func Save

func Save(r io.ReadWriter, a audio.Audio) error

Save will eventually save an audio encoded as a wav to the given writer

Types

type Data

type Data struct {
	ChunkSize uint32 // L

	Subchunk1Size uint32 // L

	AudioFormat   uint16 // L
	NumChannels   uint16 // L
	SampleRate    uint32 // L
	ByteRate      uint32 // L
	BlockAlign    uint16 // L
	BitsPerSample uint16 // L

	Subchunk2Size uint32 // L
	Data          []byte // L
	// contains filtered or unexported fields
}

Data stores the raw information contained in a wav file

func Read

func Read(r io.Reader) (Data, error)

Read returns raw wav data from an input reader

func ReadData added in v3.4.0

func ReadData(r io.Reader) (Data, error)

Jump to

Keyboard shortcuts

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