RTCEncodedAudioFrame: getMetadata() method

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since August 2023.

Note: This feature is available in Dedicated Web Workers.

The getMetadata() method of the RTCEncodedAudioFrame interface returns an object containing the metadata associated with the frame.

This includes information about the frame, such as the audio encoding used, the synchronization source and contributing sources, and the sequence number (for incoming frames).

Syntax

js
getMetadata()

Parameters

None.

Return value

An object with the following properties:

audioLevel

A number representing the audio level of this frame. The value is between 0 and 1 inclusive (linear), where 1.0 represents 0 dBov (decibels relative to full scale (DBFS)), 0 represents silence, and 0.5 represents approximately 6 dB SPL change in the sound pressure level from 0 dBov. The value is converted from the -127 to 0 range specified in RFC6464 via the equation 10^(-rfc_level/20). If the RFC6464 header extension is not present in the received packets of the frame, audioLevel will be undefined.

captureTime

A DOMHighResTimeStamp indicating the capture time of the frame relative to Performance.timeOrigin.

contributingSources

An Array of sources (ssrc) that have contributed to the frame. Consider the case of a conferencing application that combines audio from multiple users. The synchronizationSource would include the ssrc of the application, while contributingSources would include the ssrc values of all the individual audio sources.

mimeType

A string containing the MIME type of the codec used, such as "audio/opus".

payloadType

A positive integer value in the range from 0 to 127 that describes the format of the RTP payload. The mappings of values to formats is defined in RFC 3550, and more specifically Section 6: Payload Type Definitions of RFC 3551.

receiveTime

A DOMHighResTimeStamp indicating the timestamp of the last received packet of an incoming frame (from an RTCRtpReceiver) used to produce this media frame, relative to Performance.timeOrigin.

rtpTimestamp

A positive integer that reflects the sampling instant of the first octet in the RTP data packet (see RFC 3550).

sequenceNumber

The sequence number of an incoming audio frame (not used for outgoing frames) that can be used for reconstructing the original send-order of frames. This is number between 0 and 32767. Note that while numbers are allocated sequentially when sent, they will overflow at 32767 and restart back at 0. Therefore to compare two frame sequence numbers, in order to determine whether one is assumed to be after another, you must use serial number arithmetic.

synchronizationSource

A positive integer value indicating the synchronization source ("ssrc") of the stream of RTP packets that are described by this frame. A source might be something like a microphone, or a mixer application that combines multiple sources. All packets from the same source share the same time source and sequence space, and so can be ordered relative to each other. Note that two frames with the same value refer to the same source.

Examples

Getting frame metadata

This example WebRTC encoded transform implementation shows how you might get the frame metadata in a transform() function and log it.

js
addEventListener("rtctransform", (event) => {
  const transform = new TransformStream({
    async transform(encodedFrame, controller) {
      // Get the metadata and log
      const frameMetaData = encodedFrame.getMetadata();
      console.log(frameMetaData);

      // Enqueue the frame without modifying
      controller.enqueue(encodedFrame);
    },
  });
  event.transformer.readable
    .pipeThrough(transform)
    .pipeTo(event.transformer.writable);
});

The resulting object from a local microphone might look like the one shown below. Note that there are no contributing sources because there is just one source, and no sequenceNumber because this is an outgoing frame.

json
{
  "captureTime": 19745.400000000373,
  "contributingSources": [],
  "mimeType": "audio/opus",
  "payloadType": 111,
  "rtpTimestamp": 1786045165,
  "synchronizationSource": 3365032712,
  "audioLevel": 0.001584893192461114
}

Specifications

Specification
WebRTC Encoded Transform
# dom-rtcencodedaudioframe-getmetadata

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
getMetadata
Chrome – Full support
Chrome 86 (Release date: 2020-10-20)
footnote Full support
Edge – Full support
Edge 86 (Release date: 2020-10-09)
footnote Full support
Firefox – Full support
Firefox 117 (Release date: 2023-08-29)
footnote Full support
Opera – Full support
Opera 72 (Release date: 2020-10-21)
footnote Full support
Safari – Full support
Safari 15.4 (Release date: 2022-03-14)
footnote Full support
Chrome Android – Full support
Chrome Android 86 (Release date: 2020-10-20)
footnote Full support
Firefox for Android – Full support
Firefox for Android 117 (Release date: 2023-08-29)
footnote Full support
Opera Android – Full support
Opera Android 61 (Release date: 2020-12-07)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
Samsung Internet – Full support
Samsung Internet 14 (Release date: 2021-04-17)
footnote Full support
WebView Android – Full support
WebView Android 86 (Release date: 2020-10-20)
footnote Full support
WebView on iOS – Full support
WebView on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
audioLevel property in returned object
Experimental
Chrome – Full support
Chrome 139 (Release date: 2025-08-05)
footnote Full support
Edge – Full support
Edge 139 (Release date: 2025-08-07)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 123 (Release date: 2025-10-28)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 139 (Release date: 2025-08-05)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 91 (Release date: 2025-08-19)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – Full support
WebView Android 139 (Release date: 2025-08-05)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
captureTime property in returned object
Chrome – Full support
Chrome 127 (Release date: 2024-07-23)
footnote Full support
Edge – Full support
Edge 127 (Release date: 2024-07-25)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 113 (Release date: 2024-08-22)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 127 (Release date: 2024-07-23)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 84 (Release date: 2024-08-26)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 127 (Release date: 2024-07-23)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
contributingSources property in returned object
Chrome – Full support
Chrome 127 (Release date: 2024-07-23)
footnote Full support
Edge – Full support
Edge 127 (Release date: 2024-07-25)
footnote Full support
Firefox – Full support
Firefox 145 (Release date: 2025-11-11)
footnote Full support
Opera – Full support
Opera 113 (Release date: 2024-08-22)
footnote Full support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – Full support
Chrome Android 127 (Release date: 2024-07-23)
footnote Full support
Firefox for Android – Full support
Firefox for Android 145 (Release date: 2025-11-11)
footnote Full support
Opera Android – Full support
Opera Android 84 (Release date: 2024-08-26)
footnote Full support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 127 (Release date: 2024-07-23)
footnote Full support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
mimeType property in returned object
Chrome – Full support
Chrome 127 (Release date: 2024-07-23)
footnote Full support
Edge – Full support
Edge 127 (Release date: 2024-07-25)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 113 (Release date: 2024-08-22)
footnote Full support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – Full support
Chrome Android 127 (Release date: 2024-07-23)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 84 (Release date: 2024-08-26)
footnote Full support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 127 (Release date: 2024-07-23)
footnote Full support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
payloadType property in returned object
Chrome – Full support
Chrome 127 (Release date: 2024-07-23)
footnote Full support
Edge – Full support
Edge 127 (Release date: 2024-07-25)
footnote Full support
Firefox – Full support
Firefox 145 (Release date: 2025-11-11)
footnote Full support
Opera – Full support
Opera 113 (Release date: 2024-08-22)
footnote Full support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – Full support
Chrome Android 127 (Release date: 2024-07-23)
footnote Full support
Firefox for Android – Full support
Firefox for Android 145 (Release date: 2025-11-11)
footnote Full support
Opera Android – Full support
Opera Android 84 (Release date: 2024-08-26)
footnote Full support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 127 (Release date: 2024-07-23)
footnote Full support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
receiveTime property in returned object
Chrome – Full support
Chrome 127 (Release date: 2024-07-23)
footnote Full support
Edge – Full support
Edge 127 (Release date: 2024-07-25)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 113 (Release date: 2024-08-22)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 127 (Release date: 2024-07-23)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 84 (Release date: 2024-08-26)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 127 (Release date: 2024-07-23)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
rtpTimestamp property in returned object
Chrome – Full support
Chrome 127 (Release date: 2024-07-23)
footnote Full support
Edge – Full support
Edge 127 (Release date: 2024-07-25)
footnote Full support
Firefox – Full support
Firefox 145 (Release date: 2025-11-11)
footnote Full support
Opera – Full support
Opera 113 (Release date: 2024-08-22)
footnote Full support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – Full support
Chrome Android 127 (Release date: 2024-07-23)
footnote Full support
Firefox for Android – Full support
Firefox for Android 145 (Release date: 2025-11-11)
footnote Full support
Opera Android – Full support
Opera Android 84 (Release date: 2024-08-26)
footnote Full support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 127 (Release date: 2024-07-23)
footnote Full support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
sequenceNumber property in returned object
Chrome – Full support
Chrome 127 (Release date: 2024-07-23)
footnote Full support
Edge – Full support
Edge 127 (Release date: 2024-07-25)
footnote Full support
Firefox – Full support
Firefox 145 (Release date: 2025-11-11)
footnote Full support
Opera – Full support
Opera 113 (Release date: 2024-08-22)
footnote Full support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – Full support
Chrome Android 127 (Release date: 2024-07-23)
footnote Full support
Firefox for Android – Full support
Firefox for Android 145 (Release date: 2025-11-11)
footnote Full support
Opera Android – Full support
Opera Android 84 (Release date: 2024-08-26)
footnote Full support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 127 (Release date: 2024-07-23)
footnote Full support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
synchronizationSource property in returned object
Chrome – Full support
Chrome 127 (Release date: 2024-07-23)
footnote Full support
Edge – Full support
Edge 127 (Release date: 2024-07-25)
footnote Full support
Firefox – Full support
Firefox 145 (Release date: 2025-11-11)
footnote Full support
Opera – Full support
Opera 113 (Release date: 2024-08-22)
footnote Full support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – Full support
Chrome Android 127 (Release date: 2024-07-23)
footnote Full support
Firefox for Android – Full support
Firefox for Android 145 (Release date: 2025-11-11)
footnote Full support
Opera Android – Full support
Opera Android 84 (Release date: 2024-08-26)
footnote Full support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 127 (Release date: 2024-07-23)
footnote Full support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

See also