Agora Java API Reference for Android
Public Member Functions | List of all members
agora::media::IAudioSpectrumObserver Class Referenceabstract

#include <AgoraMediaBase.h>

Public Member Functions

virtual bool onLocalAudioSpectrum (const AudioSpectrumData &data)=0
 Gets the statistics of a local audio spectrum. More...
 
virtual bool onRemoteAudioSpectrum (const UserAudioSpectrumInfo *spectrums, unsigned int spectrumNumber)=0
 Gets the remote audio spectrum. More...
 

Detailed Description

The IAudioSpectrumObserver class.

Member Function Documentation

◆ onLocalAudioSpectrum()

virtual bool agora::media::IAudioSpectrumObserver::onLocalAudioSpectrum ( const AudioSpectrumData data)
pure virtual

Gets the statistics of a local audio spectrum.

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
dataThe audio spectrum data of the local user. See AudioSpectrumData.
Returns
Whether the spectrum data is received:
  • true: Spectrum data is received.
  • false: No spectrum data is received.

◆ onRemoteAudioSpectrum()

virtual bool agora::media::IAudioSpectrumObserver::onRemoteAudioSpectrum ( const UserAudioSpectrumInfo spectrums,
unsigned int  spectrumNumber 
)
pure virtual

Gets the remote audio spectrum.

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
spectrumsThe 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.
spectrumNumberThe number of remote users.
Returns
Whether the spectrum data is received:
  • true: Spectrum data is received.
  • false: No spectrum data is received.