IAudioSpectrumObserver
The audio spectrum observer.
onLocalAudioSpectrum
Gets the statistics of a local audio spectrum.
virtual bool onLocalAudioSpectrum(const AudioSpectrumData& data) = 0;
After successfully calling registerAudioSpectrumObserver to implement the onLocalAudioSpectrum callback in IAudioSpectrumObserver and calling enableAudioSpectrumMonitor to enable audio spectrum monitoring, the SDK triggers this callback as the time interval you set to report the received remote audio data spectrum before encoding.
Parameters
- data
- The audio spectrum data of the local user. See AudioSpectrumData.
Returns
true
: Spectrum data is received.false
: No spectrum data is received.
onRemoteAudioSpectrum
Gets the remote audio spectrum.
virtual bool onRemoteAudioSpectrum(const UserAudioSpectrumInfo * spectrums, unsigned int spectrumNumber) = 0;
After successfully calling registerAudioSpectrumObserver to implement the onRemoteAudioSpectrum callback in the IAudioSpectrumObserver and calling enableAudioSpectrumMonitor to enable audio spectrum monitoring, the SDK will trigger the callback as the time interval you set to report the received remote audio data spectrum.
Parameters
- spectrums
- The audio spectrum information of the remote user, see UserAudioSpectrumInfo. The number of arrays is the number of remote users monitored by the SDK. If the array is null, it means that no audio spectrum of remote users is detected.
- spectrumNumber
- The number of remote users.
Returns
true
: Spectrum data is received.false
: No spectrum data is received.