Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since August 2023.
* Some parts of this feature may have varying levels of support.
Note: This feature is available in Dedicated Web Workers.
The RTCEncodedAudioFrame of the WebRTC API represents an encoded audio frame in the WebRTC receiver or sender pipeline, which may be modified using a WebRTC Encoded Transform.
The interface provides methods and properties to get metadata about the frame, allowing its format and order in the sequence of frames to be determined. The data property gives access to the encoded frame data as a buffer, which might be encrypted, or otherwise modified by a transform.
Copy constructor. Creates a new and independent RTCEncodedAudioFrame object from a frame, optionally overwriting some of the copied metadata.
Returns the timestamp at which sampling of the frame started.
RTCEncodedAudioFrame.dataReturn a buffer containing the encoded frame data.
Returns the metadata associated with the frame.
This code snippet shows a handler for the rtctransform event in a Worker that implements a TransformStream, and pipes encoded frames through it from the event.transformer.readable to event.transformer.writable (event.transformer is a RTCRtpScriptTransformer, the worker-side counterpart of RTCRtpScriptTransform).
If the transformer is inserted into an audio stream, the transform() method is called with a RTCEncodedAudioFrame whenever a new frame is enqueued on event.transformer.readable. The transform() method shows how this might be read, modified using a fictional encryption function, and then enqueued on the controller (this ultimately pipes it through to the event.transformer.writable, and then back into the WebRTC pipeline).
Note that more complete examples are provided in Using WebRTC Encoded Transforms.
| WebRTC Encoded Transform # rtcencodedaudioframe |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Oct 23, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.