|
Agora Java API Reference for Android
|
Public Member Functions | |
| AudioParams (int sampleRate, int channelCnt, int mode, int samplesPerCall) | |
| int | getSampleRate () |
| int | getChannel () |
| int | getMode () |
| int | getSamplesPerCall () |
| String | toString () |
Public Attributes | |
| int | sampleRate = 0 |
| int | channel = 0 |
| int | mode = Constants.RAW_AUDIO_FRAME_OP_MODE_READ_ONLY |
| int | samplesPerCall = 0 |
The AudioParams class.
You can pass the AudioParams object in the return value of the following callbacks to set the audio data format for the corresponding callbacks:
samplesPerCall, sampleRate, and channelCnt values in the AudioParams object and triggers the following callbacks at the calculated sample interval:
Sample interval (seconds) = samplePerCall/(sampleRate × channelCnt). Ensure that the value of sample interval is equal to or greater than 0.01.
| int io.agora.rtc2.audio.AudioParams.sampleRate = 0 |
The audio sample rate (Hz), which can be set as one of the following values:
800016000 (Default)320004410048000 | int io.agora.rtc2.audio.AudioParams.channel = 0 |
The number of audio channels, which can be set as either of the following values:
1: Mono (Default)2: Stereo | int io.agora.rtc2.audio.AudioParams.mode = Constants.RAW_AUDIO_FRAME_OP_MODE_READ_ONLY |
The use mode of the audio data:
| int io.agora.rtc2.audio.AudioParams.samplesPerCall = 0 |
The number of samples. For example, set it as 1024 for RTMP or RTMPS streaming.
1.8.18