#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
◆ cj_ac_audio_frames_captured_handler
typedef void(* cj_ac_audio_frames_captured_handler) (short *audioFrames, size_t audioFramesLen) |
Callback delivers audio frames as they get captured.
- Parameters
-
audioFrames | Audio frames that were captured. It will contain the number of frames specified in init function (frameSize). |
audioFramesLen | Number of audio frames. |
◆ cj_ac_init()
Initializes library.
- Parameters
-
sampleRate | Sample rate of the audio being captured. The recommendation is to use the native sample rate of the microphone in order to minimize CPU usage. |
frameSize | Size of the audio frame. For example if we want to capture 20 ms of 48KHz audio, the corresponding frame size is 960. |
audioFramesCapturedHandler | Callback to receive captured audio frames. |
◆ cj_ac_pause()
void cj_ac_pause |
( |
void |
| ) |
|
Pause capturing frames.
When pausing, the library is still capturing audio frames but not calling the callback. Use pause/resume instead of start/stop when instant resumption of getting frames is necessary as starting and stopping can take a little bit of time.
◆ cj_ac_process_main_loop()
void cj_ac_process_main_loop |
( |
void |
| ) |
|
This function needs to be called regularly for the library to function.
Suggested interval is every 4 milliseconds.