|AudioParams (int sampleRate, int channelCnt, int mode, int samplesPerCall)|
|int||sampleRate = 16000|
|int||channel = 1|
|int||mode = Constants.RAW_AUDIO_FRAME_OP_MODE_READ_ONLY|
|int||samplesPerCall = 1024|
You can pass the
AudioParams object in the return value of the following callbacks to set the audio data format for the corresponding callbacks:
getRecordAudioParams: Sets the audio recording format for the
getPlaybackAudioParams: Sets the audio playback format for the
getMixedAudioParams: Sets the audio mixing format for the
channelCntvalues in the
AudioParamsobject and triggers the following callbacks at the calculated sample interval:
Sample interval (seconds) =
channelCnt). Ensure that the value of sample interval is equal to or greater than 0.01.
|int io.agora.rtc.audio.AudioParams.sampleRate = 16000|
The audio sample rate (Hz), which can be set as one of the following values:
|int io.agora.rtc.audio.AudioParams.channel = 1|
The number of audio channels, which can be set as either of the following values:
1: Mono (Default)
|int io.agora.rtc.audio.AudioParams.mode = Constants.RAW_AUDIO_FRAME_OP_MODE_READ_ONLY|
The use mode of the audio data:
RAW_AUDIO_FRAME_OP_MODE_READ_ONLY(0): (Default) Read-only mode, in which users can only read the
AudioFramewithout modifying anything. For example, this mode applies when users acquire data with the Agora SDK and then push the RTMP or RTMPS streams.
RAW_AUDIO_FRAME_OP_MODE_WRITE_ONLY(1): Write-only mode, in which users replace the
AudioFramewith their own data and then pass it to the SDK for encoding. For example, this mode applies when users need the Agora SDK to encode and transmit their custom audio data.
RAW_AUDIO_FRAME_OP_MODE_READ_WRITE(2): Read and write mode, in which users read the
AudioFrame, modify it, and then play it. For example, this mode applies when users have their own sound-effect processing module to pre-process the audio (such as a voice changer).
|int io.agora.rtc.audio.AudioParams.samplesPerCall = 1024|
The number of samples. For example, set it as 1024 for RTMP or RTMPS streaming.