TRTCVolumeInfo

TRTCVolumeInfo

Volume

Constructor

new TRTCVolumeInfo(userId, volume, vad, pitch, spectrumData, spectrumDataLength)

This indicates the audio volume value. You can use it to display the volume of each user in the UI.

Parameters:
Name Type Description
userId String required

userId of the speaker. An empty value indicates the local user. Format: UTF-8.

volume Number required

Volume of the speaker. Value range: 0–100.

vad Number required

Vad result of the local user. 0: not speech 1: speech.

pitch Number required

The local user's vocal frequency (unit: Hz), the value range is [0 - 4000]. For remote users, this value is always 0.

spectrumData Float32Array required

Audio spectrum data, which divides the sound frequency into 256 frequency domains, spectrumData records the energy value of each frequency domain, The value range of each energy value is [-300, 0] in dBFS. The local spectrum is calculated using the audio data before encoding, which will be affected by the capture volume, BGM, etc.; the remote spectrum is calculated using the received audio data, and operations such as adjusting the remote playback volume locally will not affect it.

spectrumDataLength Number required

spectrumDataLength 记录音频频谱数据的长度,为 256。