AudioSpectrumObserver
Audio spectrum observer.
onLocalAudioSpectrum
Gets the local audio spectrum.
final void Function(AudioSpectrumData data)? onLocalAudioSpectrum;
After successfully calling registerAudioSpectrumObserver to implement the onLocalAudioSpectrum callback in AudioSpectrumObserver and calling enableAudioSpectrumMonitor to enable audio spectrum monitoring, the SDK triggers this callback at the set time interval to report the spectrum of the local audio data before encoding.
Parameters
- data
- The local user's audio spectrum data. See AudioSpectrumData.
onRemoteAudioSpectrum
Gets the remote audio spectrum.
final void Function(
List<UserAudioSpectrumInfo> spectrums, int spectrumNumber)?
onRemoteAudioSpectrum;
After successfully calling registerAudioSpectrumObserver to implement the onRemoteAudioSpectrum callback in AudioSpectrumObserver and calling enableAudioSpectrumMonitor to enable audio spectrum monitoring, the SDK triggers this callback at the set time interval to report the spectrum of the received remote audio data.
Parameters
- spectrums
- The audio spectrum information of remote users. See UserAudioSpectrumInfo. The number of elements in the array equals the number of remote users detected by the SDK. An empty array means no remote audio spectrum is detected.
- spectrumNumber
- The number of remote users.