setMixedAudioFrameParameters abstract method

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

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

The SDK calculates the sampling interval using the samplesPerCall, sampleRate, and channel parameters in this method. The formula is: sampling interval = samplesPerCall / (sampleRate × channel). Ensure the sampling interval is no less than 0.01 seconds. The SDK triggers the onMixedAudioFrame callback based on this interval.

  • sampleRate The sample rate (Hz) of the audio data. You can set it to 8000, 16000, 32000, 44100, or 48000.
  • channel The number of audio channels. You can set it to 1 or 2: 1: Mono. 2: Stereo.
  • samplesPerCall The number of audio samples per call. Typically 1024 in scenarios like RTMP streaming.

Returns This method returns no value if the call succeeds. If the method call fails, it throws an AgoraRtcException, which you need to catch and handle. See Error Codes for details and troubleshooting suggestions.

Implementation

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