You can pass the AudioParams object in the following APIs to set the audio data format for the corresponding callback:
getRecordAudioParams: Sets the audio data format for the onRecordAudioFrame callback.
getPlaybackAudioParams: Sets the audio data format for the onPlaybackAudioFrame callback.
getMixedAudioParams: Sets the audio data format for the onMixedAudioFrame callback.
getEarMonitoringAudioParams: Sets the audio data format for the onEarMonitoringAudioFrame callback.
- Note
- The SDK calculates the sampling interval through the
samplesPerCall, sampleRate, and channel parameters in AudioParams, and triggers the onRecordAudioFrame, onPlaybackAudioFrame, onMixedAudioFrame, and onEarMonitoringAudioFrame callbacks according to the sampling interval.
- Sample interval (sec) =
samplePerCall /( sampleRate × channel ).
- Ensure that the sample interval ≥ 0.01 (s).