Agora C++ API Reference for All Platforms

Loading...
Searching...
No Matches
Public Member Functions | List of all members
agora::media::IAudioSpectrumObserver Class Referenceabstract

`#include <AgoraMediaBase.h>`

## Public Member Functions
virtual | ~IAudioSpectrumObserver ()
virtual bool | onLocalAudioSpectrum (const AudioSpectrumData &data)=0
virtual bool | onRemoteAudioSpectrum (const UserAudioSpectrumInfo *spectrums, unsigned int spectrumNumber)=0

## Detailed Description

The IAudioSpectrumObserver class.

## Constructor & Destructor Documentation

## ◆ ~IAudioSpectrumObserver()

virtual agora::media::IAudioSpectrumObserver::~IAudioSpectrumObserver | ( |  | ) |
| inline virtual

## Member Function Documentation

## ◆ onLocalAudioSpectrum()

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

Reports the audio spectrum of local audio.

This callback reports the audio spectrum data of the local audio at the moment in the channel.

You can set the time interval of this callback using enableAudioSpectrumMonitor.

Parameters

  data | The audio spectrum data of local audio. true: Processed. false: Not processed.

## ◆ onRemoteAudioSpectrum()

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

Reports the audio spectrum of remote user.

This callback reports the IDs and audio spectrum data of the loudest speakers at the moment in the channel.

You can set the time interval of this callback using enableAudioSpectrumMonitor.

Parameters

  spectrums | The pointer to UserAudioSpectrumInfo, which is an array containing the user ID and audio spectrum data for each speaker. This array contains the following members: `uid`, which is the UID of each remote speaker `spectrumData`, which reports the audio spectrum of each remote speaker.
  spectrumNumber | The array length of the spectrums. true: Processed. false: Not processed.