webrtc_codecs_g711 (webrtc_codecs v0.1.0)
View SourceG.711 codec plugin: PCMU (mu-law) and PCMA (A-law), 8 kHz mono, in pure Erlang.
webrtc:add_transceiver(Pc, audio, #{frames => true, codec_plugin => {webrtc_codecs_g711, #{}}}).decode/2 gives one webrtc_codecs:audio/0 per frame, at 8000 Hz,
one channel. encode/2 takes the same at 8000 Hz, one channel, and
gives one frame per ptime of samples.
Options: ptime, the frame duration in milliseconds (default 20).
Summary
Functions
Compress signed 16 bit little endian samples to one G.711 byte each.
Expand G.711 bytes to signed 16 bit little endian samples.