AgoraAudioSpectrumDelegate
The audio spectrum observer.
onLocalAudioSpectrum
Gets the statistics of a local audio spectrum.
- (BOOL)onLocalAudioSpectrum:(NSArray<NSNumber *> * _Nullable)audioSpectrumData;
After successfully calling registerAudioSpectrumDelegate to implement the onLocalAudioSpectrum callback in 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
- AudioSpectrumData
- The audio spectrum data of the local user. Agora divides the audio frequency into 160 frequency domains, and reports the energy value of each frequency domain through this parameter. The value range of each energy type is [0, 1].
Returns
YES
: Spectrum data is received.NO
: No spectrum data is received.
onRemoteAudioSpectrum
Gets the remote audio spectrum.
- (BOOL)onRemoteAudioSpectrum:(NSArray<AgoraAudioSpectrumInfo *> * _Nullable)AudioSpectrumInfo;
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
- AudioSpectrumInfo
-
The 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
YES
: Spectrum data is received.NO
: No spectrum data is received.