← sound-play

Opus packet probe

The same microphone audio read two ways: out of the encoded bitstream, and out of the samples. The bitstream column costs almost nothing and the sample column is the reference the bitstream has to agree with.

checking support…

From the packet — no decoding

mode
—
bandwidth
—
frame
—
bytes
—
rate
—
DTX
—
active
—
pitch reachable
—
packets
0

From the samples — full decode equivalent

f0
—
vs baseline
—
clarity
—
roughness
—
contour
—
speaking
—
turn
—
blocks
0
waiting for the microphone…
The production hook is not this. In a live call the packets come from RTCRtpScriptTransform: construct it with a Worker, assign it to sender.transform, and read RTCEncodedAudioFrame.data — the same Opus payload this page gets from the encoder. One rule, and it is unforgiving: the transform is a pass-through, so every frame must be re-enqueued. A reader that forgets silently kills the audio it was measuring.