Documentation
¶
Overview ¶
Package wav writes interleaved float32 PCM to classic RIFF/WAVE files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrRIFFSizeLimit indicates that the requested samples exceed the size // representable by a classic RIFF/WAVE header. ErrRIFFSizeLimit = errors.New("WAV data exceeds the classic RIFF size limit") // ErrPCMFrameAlignment indicates that the interleaved samples do not contain // complete channel frames. ErrPCMFrameAlignment = errors.New("WAV samples do not contain complete channel frames") )
Functions ¶
This section is empty.
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer writes signed 16-bit PCM samples to a classic RIFF/WAVE file.
func NewWriter ¶
NewWriter creates a classic RIFF/WAVE writer. It rejects format fields that do not fit the WAV header before creating or truncating path.
func (*Writer) Close ¶
Close patches the RIFF and data sizes from the bytes written and closes the file. Repeated calls return nil.
func (*Writer) WriteSamples ¶
WriteSamples writes complete interleaved channel frames. The sample conversion clamps to signed 16-bit range and rounds ties to even.