#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
◆ cj_ap_init()
void cj_ap_init |
( |
int |
sampleRate, |
|
|
int |
frameSize, |
|
|
int |
maxAudioFrameChunksToBuffer |
|
) |
| |
Initializes library.
- Parameters
-
sampleRate | Sample rate of the audio being played. |
frameSize | Size of the audio frame chunk. For example if we want to play 20 ms of 48KHz audio, the corresponding frame chunk size is 960. |
maxAudioFrameChunksToBuffer | Maximum number of audio frame chunks to buffer. Less chunks means less lag but can cause audio cutouts if audio packets are not queued in proper time intervals due to network jitter. More chunks means more consistent audio, but increases the lag. Recommended values are 8 for 20 ms audio chunks, 5 for 40 ms audio chunks. |
◆ cj_ap_is_mute()
bool cj_ap_is_mute |
( |
void |
| ) |
|
Check if audio player is mute.
- Returns
- true if mute, false otherwise.
◆ cj_ap_queue_audio_frames()
void cj_ap_queue_audio_frames |
( |
short * |
audioFrames, |
|
|
size_t |
audioFramesLen |
|
) |
| |
Queue next audio frames.
- Parameters
-
audioFrames | The audio frames to add to the queue. |
audioFramesLen | Number of audio frames. |