Expand description
Safe helpers around opus packet inspection and parsing
Functions§
- multistream_
packet_ pad - Pad a multistream packet to
new_lengivennb_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_
has_ lbrr - Check if packet has LBRR.
- packet_
nb_ frames - Get number of frames in a packet.
- packet_
nb_ samples - Get total samples (per channel) in a packet at the given sample rate.
- 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 frompacketand are valid as long aspacketlives. - 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].