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 ¶
- func DownsampleByte(toPCM func(byte) int16, fromPCM func(int16) byte, n float32, ...) core.HandlerFunc
- func DownsamplePCM(fromPCM func(int16) byte, n float32, handler core.HandlerFunc) core.HandlerFunc
- func FLACEncoder(codecName string, clockRate uint32, handler core.HandlerFunc) core.HandlerFunc
- func FLACHeader(magic bool, sampleRate uint32) []byte
- func LittleToBig(handler core.HandlerFunc) core.HandlerFunc
- func PCMAtoPCM(alaw byte) int16
- func PCMUtoPCM(ulaw byte) int16
- func PCMtoPCMA(pcm int16) byte
- func PCMtoPCMU(pcm int16) byte
- func RepackG711(zeroTS bool, handler core.HandlerFunc) core.HandlerFunc
- func ResamplePCM(fromPCM func(int16) byte, handler core.HandlerFunc) core.HandlerFunc
- func ResampleToG711(codec *core.Codec, sampleRate uint32, handler core.HandlerFunc) core.HandlerFunc
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 LittleToBig ¶
func LittleToBig(handler core.HandlerFunc) core.HandlerFunc
LittleToBig - conver PCM little endian to PCM big endian
func RepackG711 ¶
func RepackG711(zeroTS bool, handler core.HandlerFunc) core.HandlerFunc
RepackG711 - Repack G.711 PCMA/PCMU into frames of size 1024
- Fixes WebRTC audio quality issue (monotonic timestamp)
- Fixes Reolink Doorbell backchannel issue (zero timestamp) https://github.com/xaionaro-go/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 ¶
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.