15 #if !defined(INCLUDED_AILIA_AUDIO)
16 #define INCLUDED_AILIA_AUDIO
18 #if !defined(AILIA_API)
19 #if defined(_MSC_VER) && !defined(_WIN64)
20 #define AILIA_API __stdcall
39 #define AILIA_AUDIO_WIN_TYPE_HANN (1)
49 #define AILIA_AUDIO_WIN_TYPE_HAMMING (2)
60 #define AILIA_AUDIO_STFT_CENTER_NONE (0)
70 #define AILIA_AUDIO_STFT_CENTER_ENABLE (1)
82 #define AILIA_AUDIO_STFT_CENTER_SCIPY_DEFAULT (2)
93 #define AILIA_AUDIO_FFT_NORMALIZE_NONE (0)
103 #define AILIA_AUDIO_FFT_NORMALIZE_LIBROSA_COMPAT (1)
113 #define AILIA_AUDIO_FFT_NORMALIZE_PYTORCH_COMPAT (1)
123 #define AILIA_AUDIO_FFT_NORMALIZE_SCIPY_COMPAT (2)
134 #define AILIA_AUDIO_MEL_NORMALIZE_NONE (0)
144 #define AILIA_AUDIO_MEL_NORMALIZE_ENABLE (1)
155 #define AILIA_AUDIO_MEL_SCALE_FORMULA_HTK (1)
165 #define AILIA_AUDIO_MEL_SCALE_FORMULA_SLANYE (0)
176 #define AILIA_AUDIO_PHASE_FORM_COMPLEX (1)
186 #define AILIA_AUDIO_PHASE_FORM_REAL (0)
197 #define AILIA_AUDIO_FILTFILT_PAD_NONE (0)
208 #define AILIA_AUDIO_FILTFILT_PAD_ODD (1)
218 #define AILIA_AUDIO_FILTFILT_PAD_EVEN (2)
228 #define AILIA_AUDIO_FILTFILT_PAD_CONSTANT (3)
477 int AILIA_API ailiaAudioGetSpectrogram(
void* dst,
const void* src,
int sample_n,
int fft_n,
int hop_n,
int win_n,
int win_type,
int max_frame_n,
int center,
float power,
int norm_type);
610 int AILIA_API ailiaAudioGetMelSpectrogram(
void* dst,
const void* src,
int sample_n,
int sample_rate,
int fft_n,
int hop_n,
int win_n,
int win_type,
int max_frame_n,
int center,
float power,
int fft_norm_type,
float f_min,
float f_max,
int mel_n,
int mel_norm_type,
int mel_formula);
813 ailiaAudioResample(
void* dst,
const void* src,
int dst_sample_rate,
int dst_n,
int src_sample_rate,
int src_n);
881 int AILIA_API ailiaAudioLinerFilter(
void* dst,
const void* src,
const void* n_coef,
const void* d_coef,
void* zi,
int dst_n,
int src_n,
int n_coef_n,
int d_coef_n,
int zi_n);
959 int AILIA_API ailiaAudioFilterFilter(
void* dst,
const void* src,
const void* n_coef,
const void* d_coef,
int dst_n,
int src_n,
int n_coef_n,
int d_coef_n,
int pad_type,
int pad_len);
int AILIA_API ailiaAudioMagPhase(void *dst_mag, void *dst_phase, const void *src, int freq_n, int frame_n, float power, int phase_form)
Get the amplitude and the phase from the spectrogram.
int AILIA_API ailiaAudioStandardize(void *dst, const void *src, const int src_n)
Standardize a real signal.
int AILIA_API ailiaAudioFixFrameLen(void *dst, const void *src, int freq_n, int dst_frame_n, int src_frame_n, float pad_data)
Fix the number of time frames of a real-valued spectrogram/mel-spectrogram.
int AILIA_API ailiaAudioConvertToMel(void *dst, const void *src, const void *fb_mtrx, int freq_n, int frame_n, int mel_n)
Convert the real output of the STFT to the mel scale.
int AILIA_API ailiaAudioFilterFilter(void *dst, const void *src, const void *n_coef, const void *d_coef, int dst_n, int src_n, int n_coef_n, int d_coef_n, int pad_type, int pad_len)
Apply a zero-phase filter to the signal.
#define AILIA_API
Definition: ailia_audio.h:22
int AILIA_API ailiaAudioGetSampleLen(int *sample_n, int frame_n, int freq_n, int hop_n, int center)
Get the number of samples generated by the ISTFT.
int AILIA_API ailiaAudioConvertPowerToDB(void *dst, const void *src, int src_n, float top_db)
Convert non-negative input values to decibel scale.
int AILIA_API ailiaAudioFFT(void *dst, const void *src, int fft_n)
Execute the FFT.
int AILIA_API ailiaAudioGetFBMatrix(void *dst, const int freq_n, float f_min, float f_max, int mel_n, int sample_rate, int mel_norm, int mel_formula)
Create a mel filter-bank.
int AILIA_API ailiaAudioGetInverseSpectrogram(void *dst, const void *src, int frame_n, int freq_n, int hop_n, int win_n, int win_type, int max_sample_n, int center, int norm_type)
Generate an audio signal from a complex spectrogram.
int AILIA_API ailiaAudioIFFT(void *dst, const void *src, int fft_n)
Execute the IFFT.
int AILIA_API ailiaAudioGetSpectrogram(void *dst, const void *src, int sample_n, int fft_n, int hop_n, int win_n, int win_type, int max_frame_n, int center, float power, int norm_type)
Generate the spectrogram from the audio signal.
int AILIA_API ailiaAudioGetMelSpectrogram(void *dst, const void *src, int sample_n, int sample_rate, int fft_n, int hop_n, int win_n, int win_type, int max_frame_n, int center, float power, int fft_norm_type, float f_min, float f_max, int mel_n, int mel_norm_type, int mel_formula)
Generate the mel spectrogram from the audio signal.
int AILIA_API ailiaAudioGetFrameLen(int *frame_n, int sample_n, int fft_n, int hop_n, int center)
Get the number of frames generated by the STFT.
int AILIA_API ailiaAudioComplexNorm(void *dst, const void *src, const int src_n, float power)
Get the norm of the complex signal.
int AILIA_API ailiaAudioResample(void *dst, const void *src, int dst_sample_rate, int dst_n, int src_sample_rate, int src_n)
Resample the signal.
int AILIA_API ailiaAudioGetNonSilentPos(int *dst_start_pos, int *dst_length, const void *src, int sample_n, int win_n, int hop_n, float thr_db)
Find the region of the signal between the first and the last non-silence samples. Detects the area ex...
int AILIA_API ailiaAudioLinerFilter(void *dst, const void *src, const void *n_coef, const void *d_coef, void *zi, int dst_n, int src_n, int n_coef_n, int d_coef_n, int zi_n)
Apply a filter to the signal.
int AILIA_API ailiaAudioGetWindow(void *dst, int window_n, int win_type)
Get the window function.
int AILIA_API ailiaAudioLog1p(void *dst, const void *src, int src_n)
Convert the input values to a logarithmic scale.
int AILIA_API ailiaAudioGetResampleLen(int *dst_sample_n, int dst_sample_rate, int src_sample_n, int src_sample_rate)
Get the number of samples after the resampling.
int AILIA_API ailiaAudioGetLinerFilterZiCoef(void *dst_zi, const void *n_coef, const void *d_coef, int dst_n, int n_coef_n, int d_coef_n)
Calculate the initial delay coefficients for filtering.