Agora RTC Objective-C API Reference  Refactor
Instance Methods
<AgoraAudioSpectrumDelegate> Protocol Reference

Inherits <NSObject>.

Instance Methods

(BOOL) - onLocalAudioSpectrum:
 
(BOOL) - onRemoteAudioSpectrum:
 

Method Documentation

◆ onLocalAudioSpectrum:

- (BOOL) onLocalAudioSpectrum: (NSArray< NSNumber * > *_Nullable)  audioSpectrumData
optional

Gets the statistics of a local audio spectrum.

After successfully calling registerAudioSpectrumDelegate: to implement the onLocalAudioSpectrum: callback in AgoraAudioSpectrumDelegate 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
audioSpectrumDataThe audio spectrum data of the local user. Agora divides the audio frequency into 256 frequency domains, and reports the energy value of each frequency domain through this parameter. The value range of each energy type is [-300, 1] and the unit is dBFS.
Returns
Whether the spectrum data is received:
  • YES: Spectrum data is received.
  • NO: No spectrum data is received.

◆ onRemoteAudioSpectrum:

- (BOOL) onRemoteAudioSpectrum: (NSArray< AgoraAudioSpectrumInfo * > *_Nullable)  AudioSpectrumInfo
optional

Gets the remote audio spectrum.

After successfully calling registerAudioSpectrumDelegate: to implement the onRemoteAudioSpectrum: callback in the AgoraAudioSpectrumDelegate 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
AudioSpectrumInfoThe audio spectrum information of the remote user. See AgoraAudioSpectrumInfo. 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.
Returns
Whether the spectrum data is received:
  • YES: Spectrum data is received.
  • NO: No spectrum data is received.