Interface LocalAudioTrackStats

Information of the local audio track, which can be retrieved by calling [AgoraRTCClient.getLocalAudioStats]IAgoraRTCClient.getLocalAudioStats.

interface LocalAudioTrackStats {
    codecType?: "opus" | "aac" | "PCMU" | "PCMA" | "G722";
    currentPacketLossRate: number;
    sendBitrate: number;
    sendBytes: number;
    sendJitterMs: number;
    sendPackets: number;
    sendPacketsLost: number;
    sendRttMs: number;
    sendVolumeLevel: number;
}

Properties

codecType?: "opus" | "aac" | "PCMU" | "PCMA" | "G722"

The audio codec.

  • "opus": The audio codec is OPUS。
  • "aac": The audio codec is AAC。
  • "pcmu": Reserved for future use.
  • "pcma": Reserved for future use.
  • "g722": Reserved for future use.

Firefox does not support this property.

currentPacketLossRate: number

The packet loss rate of the sent audio in 400ms.

sendBitrate: number

The bitrate (bps) of the sent audio.

sendBytes: number

The total bytes of the sent audio.

sendJitterMs: number

Jitter (ms) of the audio packets that were sent.

sendPackets: number

The total packets of the sent audio.

sendPacketsLost: number

The total number of lost audio packets that were sent.

You can not get this property on Safari.

sendRttMs: number

Round-trip time delay (ms) of the audio packets that were sent.

sendVolumeLevel: number

The energy level of the sent audio.

The value range is [0,32767].

This value is retrieved by calling WebRTC-Stats and may not be up-to-date. To get the real-time sound volume, call [LocalAudioTrack.getVolumeLevel]ILocalAudioTrack.getVolumeLevel.