#include <optional>
#include "api/audio/echo_canceller3_config.h"
#include "modules/audio_processing/include/audio_processing.h"
namespace webrtc_audio_processing_wrapper {
struct AudioProcessing;
struct OptionalDouble {
bool has_value = false;
double value = 0.0;
};
struct OptionalBool {
bool has_value = false;
bool value = false;
};
struct OptionalInt {
bool has_value = false;
int value = 0;
};
struct Stats {
OptionalBool voice_detected;
OptionalDouble echo_return_loss;
OptionalDouble echo_return_loss_enhancement;
OptionalDouble divergent_filter_fraction;
OptionalInt delay_median_ms;
OptionalInt delay_standard_deviation_ms;
OptionalDouble residual_echo_likelihood;
OptionalDouble residual_echo_likelihood_recent_max;
OptionalInt delay_ms;
};
webrtc::StreamConfig create_stream_config(int sample_rate_hz,
size_t num_channels);
AudioProcessing* create_audio_processing(
webrtc::EchoCanceller3Config* aec3_config,
int* error);
webrtc::EchoCanceller3Config create_aec3_config();
webrtc::EchoCanceller3Config create_multichannel_aec3_config();
bool validate_aec3_config(webrtc::EchoCanceller3Config* config);
int process_capture_frame(AudioProcessing* ap,
const webrtc::StreamConfig& capture_stream_config,
float* const* channels);
int process_render_frame(AudioProcessing* ap,
const webrtc::StreamConfig& render_stream_config,
float* const* channels);
int analyze_render_frame(AudioProcessing* ap,
const webrtc::StreamConfig& render_stream_config,
const float* const* channels);
Stats get_stats(AudioProcessing* ap);
void set_config(AudioProcessing* ap,
const webrtc::AudioProcessing::Config& config);
void set_stream_delay_ms(AudioProcessing* ap, int delay);
void set_output_will_be_muted(AudioProcessing* ap, bool muted);
void set_stream_key_pressed(AudioProcessing* ap, bool pressed);
void initialize(AudioProcessing* ap);
void delete_audio_processing(AudioProcessing* ap);
}