setMixedAudioFrameParameters abstract method

Future<void> setMixedAudioFrameParameters({
  1. required int sampleRate,
  2. required int channel,
  3. required int samplesPerCall,
})

Set the format of the raw audio data after mixing for audio capture and playback.

The SDK calculates the sampling interval based on the samplesPerCall, sampleRate and channel parameters set in this method. Sample interval (sec) = samplePerCall /(sampleRate × channel). Ensure that the sample interval ≥ 0.01 (s). The SDK triggers the onMixedAudioFrame callback according to the sampling interval.

  • sampleRate The sample rate returned in the callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.
  • channel The number of audio channels. You can set the value as 1 or 2. 1: Mono. 2: Stereo.
  • samplesPerCall The number of data samples, such as 1024 for the Media Push.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly.

Implementation

Future<void> setMixedAudioFrameParameters(
    {required int sampleRate,
    required int channel,
    required int samplesPerCall});