Skip to content

Audio.Compress

Name Mandatory Description Default Type
⬅️ Input Accepts audio data as an Audio chunk, containing the sample rate, number of samples, number of channels, and the audio samples. Opus supports sample rates of 8, 12, 16, 24, or 48 kHz. Audio
Output ➡️ Outputs the compressed audio data as a sequence of Binary chunks, each containing an Opus-encoded packet. [Bytes]
Bitrate No The target bitrate in bits per second (bps). Valid values range from 500 to 512000. Use 0 for automatic bitrate management. 64000 IntVar(Int)
Application No The type of audio being encoded. Options are: "voip" (optimize for speech), "audio" (optimize for general audio), or "lowdelay" (optimize for low latency). audio StringVar(String)
Complexity No The encoding complexity, from 0 (lowest) to 10 (highest). Higher values use more CPU but may provide better quality. 10 IntVar(Int)
FrameSize No The frame size in frames (samples). Must be one of the valid Opus frame sizes for the given sample rate. Common values are 120, 240, 480, 960, 1920, or 2880 frames at 48kHz. 960 IntVar(Int)
UseMultistream No Enable if the source is multistream encoded. false BoolVar(Bool)

Compresses audio data using the Opus codec. Opus is designed for interactive speech and audio transmission over the Internet, providing high-quality compression with low latency. This shard takes raw audio data and outputs compressed Opus packets as a sequence of byte chunks.