Agora Java API Reference for Android

Public Member Functions | List of all members
io.agora.rtc2.audio.IAudioSpectrumObserver Interface Reference

## Public Member Functions
boolean | onLocalAudioSpectrum (AudioSpectrumInfo data)
boolean | onRemoteAudioSpectrum (UserAudioSpectrumInfo[] userAudioSpectrumInfos, int spectrumNumber)

## Detailed Description

The IAudioSpectrumObserver interface.

## Member Function Documentation

## ◆ onLocalAudioSpectrum()

boolean io.agora.rtc2.audio.IAudioSpectrumObserver.onLocalAudioSpectrum | ( | AudioSpectrumInfo | data | ) |

Reports the audio spectrum of audio recording.

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

You can set the time interval of this callback using {}. data The audio spectrum data of audio recording.true: Processed.false: Not processed.

## ◆ onRemoteAudioSpectrum()

boolean io.agora.rtc2.audio.IAudioSpectrumObserver.onRemoteAudioSpectrum | ( | UserAudioSpectrumInfo[] | userAudioSpectrumInfos,
|  | int | spectrumNumber
| ) |  |

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 {}.. userAudioSpectrumInfos The pointer to agora::media::AudioSpectrumInfo "AudioSpectrumInfo", 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`audioSpectrumData`, which reports the audio spectrum of each remote speaker.`spectrumDataLength`, the length of audio spectrum data. spectrumNumber The array length of the audioSpectrumInfoList.true: Processed.false: Not processed.