ai|coustics SDK 0.3.0
The ai|coustics speech enhancement SDK
Loading...
Searching...
No Matches
aic.h
Go to the documentation of this file.
1
20#ifndef AIC_SDK_H
21#define AIC_SDK_H
22
23#include <cstddef>
24#include <cstdint>
25
26
27namespace aic {
28
32constexpr static const uint32_t AIC_PASS = 0;
33
37constexpr static const uint32_t AIC_FAIL = 1;
38
43constexpr static const uint32_t AIC_FAIL_NULL_POINTER = 2;
44
48enum class LogLevel : uint32_t {
49 Error = 1,
50 Warn,
51 Debug,
52 Info,
53 Trace,
54};
55
59struct AicModel;
60
65using LogCallback = void(*)(const char*, LogLevel);
66
67
68extern "C" {
69
77uint32_t aic_log_init(LogCallback log_callback);
78
84AicModel *aic_new_model_s();
85
91AicModel *aic_new_model_m();
92
98AicModel *aic_new_model_l();
99
105AicModel *aic_new_model_z();
106
117uint32_t aic_init(AicModel *model,
118 size_t num_channels,
119 size_t sample_rate,
120 size_t num_frames);
121
132uint32_t aic_process_interleaved(AicModel *model,
133 float *buffer,
134 size_t num_channels,
135 size_t num_frames);
136
146uint32_t aic_process_deinterleaved(AicModel *model,
147 float *const *buffer,
148 size_t num_channels,
149 size_t num_frames);
150
160uint32_t aic_reset(AicModel *model);
161
170uint32_t aic_set_enhancement_strength(AicModel *model,
171 float enhancement_strength);
172
180uint32_t aic_get_enhancement_strength(AicModel *model,
181 float *enhancement_strength);
182
192uint32_t aic_set_voice_gain(AicModel *model, float voice_gain);
193
203uint32_t aic_get_voice_gain(AicModel *model,
204 float *voice_gain);
205
215uint32_t aic_get_optimal_num_frames(AicModel *model,
216 size_t *num_frames);
217
227uint32_t aic_get_optimal_sample_rate(AicModel *model,
228 size_t *sample_rate);
229
237uint32_t aic_get_latency(AicModel *model, size_t *latency);
238
244void aic_free(AicModel *model);
245
246} // extern "C"
247
248} // namespace aic
249
250#endif // AIC_SDK_H
uint32_t aic_reset(AicModel *model)
Processes a multi-channel buffer of audio data using the AicModel.
uint32_t aic_init(AicModel *model, size_t num_channels, size_t sample_rate, size_t num_frames)
Initializes the audio processing settings for the AicModel.
AicModel * aic_new_model_m()
Creates a new AicModel, using the machine learning model ModelM.
uint32_t aic_get_enhancement_strength(AicModel *model, float *enhancement_strength)
Gets the current enhancement strength for the AicModel.
uint32_t aic_get_optimal_num_frames(AicModel *model, size_t *num_frames)
Gets the optimal number of frames for the AicModel. This is the native number of frames of the model,...
AicModel * aic_new_model_z()
Creates a new AicModel, using the machine learning model ModelZ.
uint32_t aic_log_init(LogCallback log_callback)
Initializes the SDK logger.
AicModel * aic_new_model_l()
Creates a new AicModel, using the machine learning model ModelL.
uint32_t aic_get_latency(AicModel *model, size_t *latency)
Gets the current latency of the full process in samples.
uint32_t aic_set_enhancement_strength(AicModel *model, float enhancement_strength)
Sets the enhancement strength for the AicModel.
uint32_t aic_process_deinterleaved(AicModel *model, float *const *buffer, size_t num_channels, size_t num_frames)
Processes a multi-channel buffer of audio data using the AicModel.
uint32_t aic_get_voice_gain(AicModel *model, float *voice_gain)
Gets the current voice gain parameter of the AicModel. This is the gain that is added to the extracte...
LogLevel
Definition aic.h:48
uint32_t aic_set_voice_gain(AicModel *model, float voice_gain)
Sets the voice gain parameter of the AicModel. This is the gain that is added to the extracted voice ...
uint32_t aic_process_interleaved(AicModel *model, float *buffer, size_t num_channels, size_t num_frames)
Processes a buffer of interleaved audio data using the AicModel.
void(*)(const char *, LogLevel) LogCallback
Definition aic.h:65
AicModel * aic_new_model_s()
Creates a new AicModel, using the machine learning model ModelS.
void aic_free(AicModel *model)
Frees the memory used by the AicModel.
uint32_t aic_get_optimal_sample_rate(AicModel *model, size_t *sample_rate)
Gets the optimal sample rate for the AicModel. This is the native sample rate of the model,...