#ifndef AIC_H
#define AIC_H
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
typedef enum AicErrorCode {
AIC_ERROR_CODE_SUCCESS = 0,
AIC_ERROR_CODE_NULL_POINTER = 1,
AIC_ERROR_CODE_PARAMETER_OUT_OF_RANGE = 2,
AIC_ERROR_CODE_MODEL_NOT_INITIALIZED = 3,
AIC_ERROR_CODE_AUDIO_CONFIG_UNSUPPORTED = 4,
AIC_ERROR_CODE_AUDIO_CONFIG_MISMATCH = 5,
AIC_ERROR_CODE_ENHANCEMENT_NOT_ALLOWED = 6,
AIC_ERROR_CODE_INTERNAL_ERROR = 7,
AIC_ERROR_CODE_LICENSE_FORMAT_INVALID = 50,
AIC_ERROR_CODE_LICENSE_VERSION_UNSUPPORTED = 51,
AIC_ERROR_CODE_LICENSE_EXPIRED = 52,
} AicErrorCode;
typedef enum AicModelType {
AIC_MODEL_TYPE_QUAIL_L48 = 0,
AIC_MODEL_TYPE_QUAIL_L16 = 1,
AIC_MODEL_TYPE_QUAIL_L8 = 2,
AIC_MODEL_TYPE_QUAIL_S48 = 3,
AIC_MODEL_TYPE_QUAIL_S16 = 4,
AIC_MODEL_TYPE_QUAIL_S8 = 5,
AIC_MODEL_TYPE_QUAIL_XS = 6,
AIC_MODEL_TYPE_QUAIL_XXS = 7,
} AicModelType;
typedef enum AicParameter {
AIC_PARAMETER_BYPASS = 0,
AIC_PARAMETER_ENHANCEMENT_LEVEL = 1,
AIC_PARAMETER_VOICE_GAIN = 2,
AIC_PARAMETER_NOISE_GATE_ENABLE = 3,
} AicParameter;
typedef struct AicModel AicModel;
#ifdef __cplusplus
extern "C" {
#endif
enum AicErrorCode aic_model_create(struct AicModel **model,
enum AicModelType model_type,
const char *license_key);
void aic_model_destroy(struct AicModel *model);
enum AicErrorCode aic_model_initialize(struct AicModel *model,
uint32_t sample_rate,
uint16_t num_channels,
size_t num_frames,
bool allow_variable_frames);
enum AicErrorCode aic_model_reset(struct AicModel *model);
enum AicErrorCode aic_model_process_planar(struct AicModel *model,
float *const *audio,
uint16_t num_channels,
size_t num_frames);
enum AicErrorCode aic_model_process_interleaved(struct AicModel *model,
float *audio,
uint16_t num_channels,
size_t num_frames);
enum AicErrorCode aic_model_set_parameter(struct AicModel *model,
enum AicParameter parameter,
float value);
enum AicErrorCode aic_model_get_parameter(const struct AicModel *model,
enum AicParameter parameter,
float *value);
enum AicErrorCode aic_get_output_delay(const struct AicModel *model, size_t *delay);
enum AicErrorCode aic_get_optimal_sample_rate(const struct AicModel *model, uint32_t *sample_rate);
enum AicErrorCode aic_get_optimal_num_frames(const struct AicModel *model,
uint32_t sample_rate,
size_t *num_frames);
const char *aic_get_sdk_version(void);
#ifdef __cplusplus
} #endif
#endif