registerAudioSpectrumObserver abstract method

void registerAudioSpectrumObserver(
  1. AudioSpectrumObserver observer
)

Register an audio spectrum observer.

After successfully registering the audio spectrum observer and calling enableAudioSpectrumMonitor to enable the audio spectrum monitoring, the SDK reports the callback that you implement in the AudioSpectrumObserver class according to the time interval you set. You can call this method either before or after joining a channel.

  • observer The audio spectrum observer. See AudioSpectrumObserver.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly.

Implementation

void registerAudioSpectrumObserver(AudioSpectrumObserver observer);