pcm

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 7 Imported by: 0

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 DownsampleByte

func DownsampleByte(
	toPCM func(byte) int16, fromPCM func(int16) byte, n float32, handler core.HandlerFunc,
) core.HandlerFunc

DownsampleByte - convert PCMA/PCMU to PCMA/PCMU with decreasing sample rate (N times)

func DownsamplePCM

func DownsamplePCM(fromPCM func(int16) byte, n float32, handler core.HandlerFunc) core.HandlerFunc

DownsamplePCM - convert PCM to PCMA/PCMU with decreasing sample rate (N times)

func FLACEncoder

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

func FLACHeader

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

func LittleToBig added in v1.6.1

func LittleToBig(handler core.HandlerFunc) core.HandlerFunc

LittleToBig - conver PCM little endian to PCM big endian

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 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 ResamplePCM

func ResamplePCM(fromPCM func(int16) byte, handler core.HandlerFunc) core.HandlerFunc

ResamplePCM - convert PCM to PCMA/PCMU with same sample rate

func ResampleToG711 added in v1.6.1

func ResampleToG711(codec *core.Codec, sampleRate uint32, handler core.HandlerFunc) core.HandlerFunc

ResampleToG711 - convert PCMA/PCM/PCML to PCMA and PCMU to PCMU with decreasing sample rate

Types

This section is empty.

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