Module packet

Module packet 

Source
Expand description

Safe helpers around opus packet inspection and parsing

Functions§

multistream_packet_pad
Pad a multistream packet to new_len given nb_streams.
multistream_packet_unpad
Remove padding from a multistream packet; returns new length.
packet_bandwidth
Get bandwidth from a packet.
packet_channels
Get channel count encoded by the packet.
packet_frame_count
Get number of frames in a packet.
packet_has_lbrr
Check if packet has LBRR.
packet_pad
Increase a packet’s size by adding padding to reach new_len.
packet_parse
Parse packet into frame pointers and sizes. Returns (toc, payload_offset, frame_sizes). Note: Returned frame slices borrow from packet and are valid as long as packet lives.
packet_sample_count
Get total samples (per channel) in a packet at the given sample rate.
packet_samples_per_frame
Get the number of samples per frame for a packet at a given sample rate.
packet_unpad
Remove padding from a packet; returns new length or error.
soft_clip
Apply libopus soft clipping to keep float PCM within [-1, 1].