wavwriter

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package wavwriter provides a media writer that writes bytes in μ-law (PCMU) or A-law (PCMA) format to a WAV file.

Index

Constants

View Source
const (
	WavAudioFormatPcmRaw = 1 //no compression, raw (linear) pcm
	// a WavAudioFormat value of 6 or 7 would indicate that the audio data is stored in the A-law or μ-law format, which are forms of compressed PCM commonly used in telephony.
	WavAudioFormatPcmA = 6 //A-law
	WavAudioFormatPcmU = 7 //μ-law
)

Variables

View Source
var ErrorInvalidPcmType = fmt.Errorf("invalid pcm type")

Functions

This section is empty.

Types

type WavWriter

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

func New

func New(fileName string, sampleRate uint32, channelCount uint16, pcmType int) (*WavWriter, error)

func (*WavWriter) Close

func (i *WavWriter) Close() error

Close stops the recording

func (*WavWriter) DecodePcmaToPcmWrite

func (i *WavWriter) DecodePcmaToPcmWrite(pcma []byte) error

func (*WavWriter) DecodePcmuToPcmWrite

func (i *WavWriter) DecodePcmuToPcmWrite(pcmu []byte) error

func (*WavWriter) Write

func (i *WavWriter) Write(bs []byte) error

func (*WavWriter) WriteInt16

func (i *WavWriter) WriteInt16(int16Data []int16) error

func (*WavWriter) WriteRTP

func (i *WavWriter) WriteRTP(packet *rtp.Packet) error

WriteRTP adds a new packet and writes the appropriate headers for it

Jump to

Keyboard shortcuts

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