wav

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 6 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package wav reads 16-bit PCM WAV files into mono float32 samples and writes float32 stereo WAV files. It uses the standard library only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(r io.Reader) (samples []float32, rate int, err error)

Read decodes a 16-bit PCM WAV file (format 1, or WAVE_FORMAT_EXTENSIBLE with the PCM subformat) of any channel count. It returns the channels mixed to mono as samples from -1 to 1, and the sample rate. Chunks other than "fmt " and "data" are skipped. Errors start with "wav: ".

func WriteStereo

func WriteStereo(w io.Writer, rate int, left, right []float32) error

WriteStereo writes left and right (same length, samples -1 to 1) as an interleaved 32-bit float stereo WAV file at rate.

Types

This section is empty.

Jump to

Keyboard shortcuts

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