Agora RTC Objective-C API Reference  Refactor
Public Member Functions
IAudioSpectrumObserver Class Referenceabstract

Public Member Functions

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 ~IAudioSpectrumObserver ( )
inlinevirtual

Member Function Documentation

◆ onLocalAudioSpectrum()

virtual bool 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
dataThe audio spectrum data of local audio.
  • true: Processed.
  • false: Not processed.

◆ onRemoteAudioSpectrum()

virtual bool 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
spectrumsThe 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.
spectrumNumberThe array length of the spectrums.
  • true: Processed.
  • false: Not processed.