IAudioSpectrumObserver

Audio spectrum observer.

onLocalAudioSpectrum

Gets the local audio spectrum.

onLocalAudioSpectrum?(data: AudioSpectrumData): void;

After successfully calling registerAudioSpectrumObserver to implement the onLocalAudioSpectrum callback in IAudioSpectrumObserver and calling enableAudioSpectrumMonitor to enable audio spectrum monitoring, the SDK triggers this callback at the interval you set to report the spectrum of local audio data before encoding.

Parameters

data
The local user's audio spectrum data. See AudioSpectrumData.

onRemoteAudioSpectrum

Gets the remote audio spectrum.

onRemoteAudioSpectrum?(
    spectrums: UserAudioSpectrumInfo[],
    spectrumNumber: number
  ): void;

After successfully calling registerAudioSpectrumObserver to implement the onRemoteAudioSpectrum callback in IAudioSpectrumObserver and calling enableAudioSpectrumMonitor to enable audio spectrum monitoring, the SDK triggers this callback at the interval you set to report the spectrum of received remote audio data.

Parameters

spectrums
The audio spectrum information of remote users. See UserAudioSpectrumInfo. The number of elements in the array equals the number of remote users monitored by the SDK. An empty array indicates no remote user audio spectrum is detected.
spectrumNumber
The number of remote users.