56#if defined(__cplusplus) && defined(_WIN32)
87#define CLIENT_AUDIO_PIPELINE_SAMPLE_RATE 48000
90#define CLIENT_AUDIO_PIPELINE_FRAME_MS 20
93#define CLIENT_AUDIO_PIPELINE_FRAME_SIZE (CLIENT_AUDIO_PIPELINE_SAMPLE_RATE * CLIENT_AUDIO_PIPELINE_FRAME_MS / 1000)
96#define CLIENT_AUDIO_PIPELINE_ECHO_REF_SIZE (CLIENT_AUDIO_PIPELINE_SAMPLE_RATE / 2)
99#define CLIENT_AUDIO_PIPELINE_MAX_OPUS_PACKET 4000
133#define CLIENT_AUDIO_PIPELINE_FLAGS_ALL \
134 ((client_audio_pipeline_flags_t){ \
135 .echo_cancel = true, \
136 .noise_suppress = true, \
139 .jitter_buffer = true, \
140 .compressor = true, \
141 .noise_gate = true, \
149#define CLIENT_AUDIO_PIPELINE_FLAGS_MINIMAL \
150 ((client_audio_pipeline_flags_t){ \
151 .echo_cancel = false, \
152 .noise_suppress = false, \
155 .jitter_buffer = false, \
156 .compressor = false, \
157 .noise_gate = false, \
369 uint8_t *opus_out,
int opus_out_size);
397 float *output,
int max_samples);
438 int render_count,
const float *capture_samples,
int capture_count,
439 float *processed_output);
struct SpeexPreprocessState_ SpeexPreprocessState
client_audio_pipeline_t * client_audio_pipeline_create(const client_audio_pipeline_config_t *config)
Create a new client audio pipeline.
void client_audio_pipeline_process_duplex(client_audio_pipeline_t *pipeline, const float *render_samples, int render_count, const float *capture_samples, int capture_count, float *processed_output)
Process AEC3 inline in full-duplex callback.
client_audio_pipeline_flags_t client_audio_pipeline_get_flags(client_audio_pipeline_t *pipeline)
Get current component enable flags.
bool client_audio_pipeline_voice_detected(client_audio_pipeline_t *pipeline)
Check if VAD detected voice activity in last capture.
int client_audio_pipeline_jitter_margin(client_audio_pipeline_t *pipeline)
Get jitter buffer margin (buffered time in ms)
struct OpusDecoder OpusDecoder
int client_audio_pipeline_get_playback_frame(client_audio_pipeline_t *pipeline, float *output, int num_samples)
Get audio frame from jitter buffer for playback callback.
client_audio_pipeline_config_t client_audio_pipeline_default_config(void)
Get default configuration.
int client_audio_pipeline_playback(client_audio_pipeline_t *pipeline, const uint8_t *opus_in, int opus_len, float *output, int max_samples)
Decode Opus packet and process for playback.
struct webrtc_EchoCanceller3 webrtc_EchoCanceller3
void client_audio_pipeline_set_flags(client_audio_pipeline_t *pipeline, client_audio_pipeline_flags_t flags)
Set component enable flags.
void client_audio_pipeline_destroy(client_audio_pipeline_t *pipeline)
Destroy a client audio pipeline.
int client_audio_pipeline_capture(client_audio_pipeline_t *pipeline, const float *input, int num_samples, uint8_t *opus_out, int opus_out_size)
Process captured audio and encode to Opus.
struct JitterBuffer_ JitterBuffer
struct OpusEncoder OpusEncoder
void client_audio_pipeline_reset(client_audio_pipeline_t *pipeline)
Reset pipeline state.
Multi-Source Audio Mixing and Processing System.
Cross-platform mutex interface for ascii-chat.
Pipeline configuration parameters.
client_audio_pipeline_flags_t flags
Component enable/disable flags.
Client audio pipeline state.
client_audio_pipeline_config_t config
int capture_fadein_remaining
void * aec3_render_buffer
void * debug_wav_aec3_out
client_audio_pipeline_flags_t flags
noise_gate_t playback_noise_gate
SpeexPreprocessState * preprocess
uint32_t jitter_timestamp
highpass_filter_t highpass
void * aec3_capture_buffer
Dynamic range compressor settings and state.
High-pass filter settings and state.
Noise gate settings and state.