setPlaybackAudioFrameParameters abstract method
Future<void>
setPlaybackAudioFrameParameters({
- required int sampleRate,
- required int channel,
- required RawAudioFrameOpModeType mode,
- required int samplesPerCall,
Sets the audio data format for playback.
Sets the data format for the onPlaybackAudioFrame callback. Ensure that you call this method before joining a channel. 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 onPlaybackAudioFrame callback according to the sampling interval.
sampleRate
The sample rate returned in the onPlaybackAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.channel
The number of channels returned in the onPlaybackAudioFrame callback: 1: Mono. 2: Stereo.mode
The use mode of the audio frame. See RawAudioFrameOpModeType.samplesPerCall
The number of data samples returned in the onPlaybackAudioFrame callback, 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. < 0: Failure.
Implementation
Future<void> setPlaybackAudioFrameParameters(
{required int sampleRate,
required int channel,
required RawAudioFrameOpModeType mode,
required int samplesPerCall});