ai|coustics SDK 0.3.0
The ai|coustics speech enhancement SDK
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
aic.h File Reference

Header file for the ai-coustics speech enhancement SDK. More...

#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Typedefs

using aic::LogCallback = void(*)(const char *, LogLevel)
 

Enumerations

enum class  aic::LogLevel : uint32_t {
  Error = 1 , Warn , Debug , Info ,
  Trace
}
 

Functions

uint32_t aic::aic_log_init (LogCallback log_callback)
 Initializes the SDK logger.
 
AicModel * aic::aic_new_model_s ()
 Creates a new AicModel, using the machine learning model ModelS.
 
AicModel * aic::aic_new_model_m ()
 Creates a new AicModel, using the machine learning model ModelM.
 
AicModel * aic::aic_new_model_l ()
 Creates a new AicModel, using the machine learning model ModelL.
 
AicModel * aic::aic_new_model_z ()
 Creates a new AicModel, using the machine learning model ModelZ.
 
uint32_t aic::aic_init (AicModel *model, size_t num_channels, size_t sample_rate, size_t num_frames)
 Initializes the audio processing settings for the AicModel.
 
uint32_t aic::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.
 
uint32_t aic::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::aic_reset (AicModel *model)
 Processes a multi-channel buffer of audio data using the AicModel.
 
uint32_t aic::aic_set_enhancement_strength (AicModel *model, float enhancement_strength)
 Sets the enhancement strength for the AicModel.
 
uint32_t aic::aic_get_enhancement_strength (AicModel *model, float *enhancement_strength)
 Gets the current enhancement strength for the AicModel.
 
uint32_t aic::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 before the mixback to the original signal is happening.
 
uint32_t aic::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 extracted voice before the mixback to the original signal is happening.
 
uint32_t aic::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, that causes the lowest latency.
 
uint32_t aic::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, that causes the lowest latency.
 
uint32_t aic::aic_get_latency (AicModel *model, size_t *latency)
 Gets the current latency of the full process in samples.
 
void aic::aic_free (AicModel *model)
 Frees the memory used by the AicModel.
 

Detailed Description

Header file for the ai-coustics speech enhancement SDK.

This file contains the definitions and declarations for the ai-coustics speech enhancement SDK, including initialization, processing, and configuration functions. The ai-coustics SDK provides advanced machine learning models for speech enhancement, that can be used in audio streaming contexts.

Unauthorized copying, distribution, or modification of this file, via any medium, is strictly prohibited.

For inquiries, please contact: info@.nosp@m.ai-c.nosp@m.ousti.nosp@m.cs.c.nosp@m.om

Typedef Documentation

◆ LogCallback

using aic::LogCallback = typedef void(*)(const char*, LogLevel)

The SDK will call this function to allow the user to receive logs. The first parameter is a pointer to the log message, and the second parameter is the level of that log.

Enumeration Type Documentation

◆ LogLevel

enum class aic::LogLevel : uint32_t
strong

Levels for the log callback.

Function Documentation

◆ aic_free()

void aic::aic_free ( AicModel *  model)

Frees the memory used by the AicModel.

Parameters
modelA pointer to the AicModel.

◆ aic_get_enhancement_strength()

uint32_t aic::aic_get_enhancement_strength ( AicModel *  model,
float *  enhancement_strength 
)

Gets the current enhancement strength for the AicModel.

Parameters
modelA pointer to the AicModel.
enhancement_strengthA pointer to the variable that will store the current strength.
Returns
AIC_PASS on success, or an error code on failure.

◆ aic_get_latency()

uint32_t aic::aic_get_latency ( AicModel *  model,
size_t *  latency 
)

Gets the current latency of the full process in samples.

Parameters
modelA pointer to the AicModel.
latencyA pointer to the variable that will store the latency value.
Returns
AIC_PASS on success, or an error code on failure.

◆ aic_get_optimal_num_frames()

uint32_t aic::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, that causes the lowest latency.

Parameters
modelA pointer to the AicModel.
num_framesA pointer to the variable that will store the optimal number of frames.
Returns
AIC_PASS on success, or an error code on failure.

◆ aic_get_optimal_sample_rate()

uint32_t aic::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, that causes the lowest latency.

Parameters
modelA pointer to the AicModel.
sample_rateA pointer to the variable that will store the optimal sample rate.
Returns
AIC_PASS on success, or an error code on failure.

◆ aic_get_voice_gain()

uint32_t aic::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 extracted voice before the mixback to the original signal is happening.

Parameters
modelA pointer to the AicModel.
voice_gainA pointer to the variable that will store the voice gain parameter.
Returns
AIC_PASS on success, or an error code on failure.

◆ aic_init()

uint32_t aic::aic_init ( AicModel *  model,
size_t  num_channels,
size_t  sample_rate,
size_t  num_frames 
)

Initializes the audio processing settings for the AicModel.

Parameters
modelA pointer to the AicModel.
num_channelsThe number of audio channels being processed.
sample_rateThe sample rate of the audio being processed.
num_framesThe number of audio frames processed per callback.
Returns
AIC_PASS on success, or an error code on failure.
Note
This function has to be called before the process function.

◆ aic_log_init()

uint32_t aic::aic_log_init ( LogCallback  log_callback)

Initializes the SDK logger.

Parameters
log_callbackA callback function that the SDK will use to send log messages
Returns
AIC_PASS on success, or AIC_FAIL if the SDK logging system was already initialized.
Note
This function must only be called once.

◆ aic_new_model_l()

AicModel * aic::aic_new_model_l ( )

Creates a new AicModel, using the machine learning model ModelL.

Returns
A pointer to the newly created AicModel.

◆ aic_new_model_m()

AicModel * aic::aic_new_model_m ( )

Creates a new AicModel, using the machine learning model ModelM.

Returns
A pointer to the newly created AicModel.

◆ aic_new_model_s()

AicModel * aic::aic_new_model_s ( )

Creates a new AicModel, using the machine learning model ModelS.

Returns
A pointer to the newly created AicModel.

◆ aic_new_model_z()

AicModel * aic::aic_new_model_z ( )

Creates a new AicModel, using the machine learning model ModelZ.

Returns
A pointer to the newly created AicModel.

◆ aic_process_deinterleaved()

uint32_t aic::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.

Parameters
modelA pointer to the AicModel.
bufferA pointer to the audio data.
num_channelsThe number of channels.
num_framesThe number of audio frames in the buffer.
Returns
AIC_PASS on success, or an error code on failure.

◆ aic_process_interleaved()

uint32_t aic::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.

Parameters
modelA pointer to the AicModel.
bufferA pointer to the audio data.
num_channelsThe number of channels.
num_framesThe number of audio frames in the buffer.
Returns
AIC_PASS on success, or an error code on failure.
Note
The buffer has to be num_channels * num_frames long.

◆ aic_reset()

uint32_t aic::aic_reset ( AicModel *  model)

Processes a multi-channel buffer of audio data using the AicModel.

Parameters
modelA pointer to the AicModel.
bufferA pointer to the audio data.
num_channelsThe number of channels.
num_framesThe number of audio frames in the buffer.
Returns
AIC_PASS on success, or an error code on failure.

◆ aic_set_enhancement_strength()

uint32_t aic::aic_set_enhancement_strength ( AicModel *  model,
float  enhancement_strength 
)

Sets the enhancement strength for the AicModel.

Parameters
modelA pointer to the AicModel.
enhancement_strengthValue between 0.0 and 1.0, where 0.0 is equal to a bypass and 1.0 is the maximum enhancement.
Returns
AIC_PASS on success, or an error code on failure.

◆ aic_set_voice_gain()

uint32_t aic::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 before the mixback to the original signal is happening.

Parameters
modelA pointer to the AicModel.
voice_gainThe voice gain parameter to set.
Returns
AIC_PASS on success, or an error code on failure.