audiocodec

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

README

audiocodec

Documentation

Index

Constants

View Source
const (
	WavHeaderSize = 44
)

Variables

This section is empty.

Functions

func FlacToWav

func FlacToWav(flacStream io.Reader, writer io.WriteSeeker) (totalBytes int, totalSamples int, sampleRate int, err error)

func GenerateWavHeader

func GenerateWavHeader(pcmSize int, sampleRate int, numChannels int, bitsPerSample int) []byte

func Int32toInt24LEBytes

func Int32toInt24LEBytes(n int32) []byte

func ParseWavHeader

func ParseWavHeader(wavStream io.Reader) (pcmSize int, sampleRate int, numChannels int, bitsPerSample int, err error)

The caller can use the following statement to avoid reading trailing metadata as audio. wavStream = io.LimitReader(wavStream, int64(pcmSize))

Types

type WriterSeeker

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

WriterSeeker is an in-memory io.WriteSeeker implementation

func (*WriterSeeker) Bytes

func (ws *WriterSeeker) Bytes() []byte

func (*WriterSeeker) BytesReader

func (ws *WriterSeeker) BytesReader() *bytes.Reader

BytesReader returns a *bytes.Reader. Use it when you need a reader that implements the io.ReadSeeker interface

func (*WriterSeeker) Close

func (ws *WriterSeeker) Close() error

Close :

func (*WriterSeeker) Seek

func (ws *WriterSeeker) Seek(offset int64, whence int) (int64, error)

Seek seeks in the buffer of this WriterSeeker instance

func (*WriterSeeker) Write

func (ws *WriterSeeker) Write(p []byte) (n int, err error)

Write writes to the buffer of this WriterSeeker instance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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