Discover Packages
github.com/darui3018823/opus
internal
extensions
package
Version:
v1.2.0
Opens a new window with list of versions in this module.
Published: Jun 25, 2026
License: BSD-2-Clause
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package extensions implements the Opus packet-extension grammar carried in
RFC 6716 code-3 padding.
View Source
const (
MinID = 3
MaxID = 127
MaxFrames = 48
)
View Source
var (
ErrBadArg = errors .New ("extensions: bad argument")
ErrInvalidPacket = errors .New ("extensions: invalid packet")
ErrBufferTooSmall = errors .New ("extensions: buffer too small")
)
Count validates and counts the extensions in an extension-bearing padding
region. Repeat indicators count once for every expanded frame occurrence.
Generate encodes extensions using the libopus repeat and separator grammar.
targetLen==0 produces the minimal representation. A positive targetLen
produces exactly that many bytes by prepending extension padding bytes.
type Extension struct {
ID int
Frame int
Data []byte
}
Extension is one decoded packet extension. Data is owned by the caller.
Parse decodes an extension-bearing padding region in bitstream order.
Repeat indicators are expanded into one Extension per target frame.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.