wav

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: ISC Imports: 4 Imported by: 0

Documentation

Overview

Package wav implements access to WAV (or WAVE) files. WAVE is a file format for storing digitised audio, most commonly as raw PCM signals.

See also https://en.wikipedia.org/wiki/WAV

Index

Constants

View Source
const (
	AudioFormatPCMInteger uint16 = 1
	AudioFormatFloat      uint16 = 3
	AudioFormatExtensible uint16 = 0xfffe
)

Variables

This section is empty.

Functions

func EncodeHeader

func EncodeHeader(hdr Header) []byte

Types

type File

type File struct {
	Header    Header
	Bitstream io.Reader
}

func ReadFile

func ReadFile(r io.Reader) (*File, error)

type FormatExtension

type FormatExtension struct {
	Length      uint16
	ValidBits   uint16
	ChannelMask uint32
	SubFormat   [16]byte
}
type Header struct {
	FileSize uint32

	AudioFormat    uint16
	ChannelCount   uint16
	Frequency      uint32
	BytesPerSecond uint32
	BytesPerBloc   uint16
	BitsPerSample  uint16
	Extension      *FormatExtension

	DataSize uint32
}

Jump to

Keyboard shortcuts

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