pcm

package
v1.9.11 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: MIT Imports: 12 Imported by: 1

Documentation

Overview

Package pcm - support raw (verbatim) PCM 16 bit in the FLAC container: - only 1 channel - only 16 bit per sample - only 8000, 16000, 24000, 48000 sample rate

Package pcm https://www.codeproject.com/Articles/14237/Using-the-G711-standard

Package pcm https://www.codeproject.com/Articles/14237/Using-the-G711-standard

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesPerDuration added in v1.9.10

func BytesPerDuration(codec *core.Codec, duration time.Duration) int

func BytesPerFrame added in v1.9.10

func BytesPerFrame(codec *core.Codec) int

func BytesPerSample added in v1.9.10

func BytesPerSample(codec *core.Codec) int

func ConsumerCodecs added in v1.9.10

func ConsumerCodecs() []*core.Codec

func Downsample added in v1.9.10

func Downsample(k float32) func([]int16) []int16

func FLACEncoder

func FLACEncoder(codecName string, clockRate uint32, handler core.HandlerFunc) core.HandlerFunc

func FLACHeader

func FLACHeader(magic bool, sampleRate uint32) []byte

func FlipEndian added in v1.9.10

func FlipEndian(src []byte) (dst []byte)

func FramesPerDuration added in v1.9.10

func FramesPerDuration(codec *core.Codec, duration time.Duration) int

func LittleToBig added in v1.6.1

func LittleToBig(handler core.HandlerFunc) core.HandlerFunc

LittleToBig - convert PCM little endian to PCM big endian

func NewBackchannel added in v1.9.10

func NewBackchannel(cmd *shell.Command, audio string) (core.Producer, error)

func PCMAtoPCM

func PCMAtoPCM(alaw byte) int16

func PCMUtoPCM

func PCMUtoPCM(ulaw byte) int16

func PCMtoPCMA

func PCMtoPCMA(pcm int16) byte

func PCMtoPCMU

func PCMtoPCMU(pcm int16) byte

func ProducerCodecs added in v1.9.10

func ProducerCodecs() []*core.Codec

func RepackG711 added in v1.6.0

func RepackG711(zeroTS bool, handler core.HandlerFunc) core.HandlerFunc

RepackG711 - Repack G.711 PCMA/PCMU into frames of size 1024

  1. Fixes WebRTC audio quality issue (monotonic timestamp)
  2. Fixes Reolink Doorbell backchannel issue (zero timestamp) https://github.com/AlexxIT/go2rtc/issues/331

func Transcode added in v1.9.10

func Transcode(dst, src *core.Codec) func([]byte) []byte

func TranscodeHandler added in v1.9.10

func TranscodeHandler(dst, src *core.Codec, handler core.HandlerFunc) core.HandlerFunc

func Upsample added in v1.9.10

func Upsample(k float32) func([]int16) []int16

Types

type Backchannel added in v1.9.10

type Backchannel struct {
	core.Connection
	// contains filtered or unexported fields
}

func (*Backchannel) AddTrack added in v1.9.10

func (c *Backchannel) AddTrack(media *core.Media, codec *core.Codec, track *core.Receiver) error

func (*Backchannel) GetTrack added in v1.9.10

func (c *Backchannel) GetTrack(media *core.Media, codec *core.Codec) (*core.Receiver, error)

func (*Backchannel) Start added in v1.9.10

func (c *Backchannel) Start() error

type Producer added in v1.9.8

type Producer struct {
	core.Connection
	// contains filtered or unexported fields
}

func Open added in v1.9.8

func Open(rd io.Reader) (*Producer, error)

func (*Producer) Start added in v1.9.8

func (c *Producer) Start() error

type ProducerSync added in v1.9.10

type ProducerSync struct {
	core.Connection
	// contains filtered or unexported fields
}

func OpenSync added in v1.9.10

func OpenSync(codec *core.Codec, rd io.Reader) *ProducerSync

func (*ProducerSync) OnClose added in v1.9.10

func (p *ProducerSync) OnClose(f func())

func (*ProducerSync) Start added in v1.9.10

func (p *ProducerSync) Start() error

Directories

Path Synopsis
Package v1 http://web.archive.org/web/20110719132013/http://hazelware.luggle.com/tutorials/mulawcompression.html
Package v1 http://web.archive.org/web/20110719132013/http://hazelware.luggle.com/tutorials/mulawcompression.html

Jump to

Keyboard shortcuts

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