ailia_voice
1.3.0.0
|
#include "ailia.h"
#include "ailia_audio.h"
Go to the source code of this file.
Classes | |
struct | _AILIAVoiceApiCallback |
Typedefs | |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_AUDIO_RESAMPLE) (void *, const void *, int, int, int, int) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_AUDIO_GET_RESAMPLE_LEN) (int *, int, int, int) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_CREATE) (struct AILIANetwork **, int, int) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_OPEN_WEIGHT_FILE_A) (struct AILIANetwork *, const char *) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_OPEN_WEIGHT_FILE_W) (struct AILIANetwork *, const wchar_t *) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_OPEN_WEIGHT_MEM) (struct AILIANetwork *, const void *, unsigned int) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_SET_MEMORY_MODE) (struct AILIANetwork *, unsigned int) |
typedef void(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_DESTROY) (struct AILIANetwork *) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_UPDATE) (struct AILIANetwork *) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_GET_BLOB_INDEX_BY_INPUT_INDEX) (struct AILIANetwork *, unsigned int *, unsigned int) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_GET_BLOB_INDEX_BY_OUTPUT_INDEX) (struct AILIANetwork *, unsigned int *, unsigned int) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_GET_BLOB_DATA) (struct AILIANetwork *, void *, unsigned int, unsigned int) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_SET_INPUT_BLOB_DATA) (struct AILIANetwork *, const void *, unsigned int, unsigned int) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_SET_INPUT_BLOB_SHAPE) (struct AILIANetwork *, const AILIAShape *, unsigned int, unsigned int) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_GET_BLOB_SHAPE) (struct AILIANetwork *, AILIAShape *, unsigned int, unsigned int) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_GET_INPUT_BLOB_COUNT) (struct AILIANetwork *, unsigned int *) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_GET_OUTPUT_BLOB_COUNT) (struct AILIANetwork *, unsigned int *) |
typedef int(AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_COPY_BLOB_DATA) (struct AILIANetwork *dst_net, unsigned int dst_blob_idx, struct AILIANetwork *src_net, unsigned int src_blob_idx) |
typedef struct _AILIAVoiceApiCallback | AILIAVoiceApiCallback |
Functions | |
const typedef char *AILIA_VOICE_USER_API * | AILIA_VOICE_USER_API_AILIA_GET_ERROR_DETAIL (struct AILIANetwork *) |
int AILIA_API | ailiaVoiceCreate (struct AILIAVoice **net, int env_id, int num_thread, int memory_mode, int flags, AILIAVoiceApiCallback callback, int version) |
Creates a Voice instance. More... | |
int AILIA_API | ailiaVoiceSetUserDictionaryFileA (struct AILIAVoice *net, const char *dictionary_path, int dictionary_type) |
Set user dictionary into a network instance. More... | |
int AILIA_API | ailiaVoiceSetUserDictionaryFileW (struct AILIAVoice *net, const wchar_t *dictionary_path, int dictionary_type) |
Set user dictionary into a network instance. More... | |
int AILIA_API | ailiaVoiceOpenDictionaryFileA (struct AILIAVoice *net, const char *dictionary_path, int dictionary_type) |
Set dictionary into a network instance. More... | |
int AILIA_API | ailiaVoiceOpenDictionaryFileW (struct AILIAVoice *net, const wchar_t *dictionary_path, int dictionary_type) |
Set dictionary into a network instance. More... | |
int AILIA_API | ailiaVoiceOpenModelFileA (struct AILIAVoice *net, const char *encoder, const char *decoder1, const char *decoder2, const char *wave, const char *ssl, int model_type, int cleaner_type) |
Set models into a network instance. More... | |
int AILIA_API | ailiaVoiceOpenModelFileW (struct AILIAVoice *net, const wchar_t *encoder, const wchar_t *decoder1, const wchar_t *decoder2, const wchar_t *wave, const wchar_t *ssl, int model_type, int cleaner_type) |
Set models into a network instance. More... | |
int AILIA_API | ailiaVoiceGraphemeToPhoneme (struct AILIAVoice *net, const char *utf8, int g2p_type) |
Perform g2p. More... | |
int AILIA_API | ailiaVoiceExtractFullContext (struct AILIAVoice *net, const char *utf8) |
Perform ExtractFullContext. More... | |
int AILIA_API | ailiaVoiceGetFeatureLength (struct AILIAVoice *net, unsigned int *len) |
Gets the size of features. (Include null) More... | |
int AILIA_API | ailiaVoiceGetFeatures (struct AILIAVoice *net, char *features, unsigned int len) |
Gets the decoded features. More... | |
int AILIA_API | ailiaVoiceSetReference (struct AILIAVoice *net, float *buf, unsigned int buf_size, unsigned int channels, unsigned int sampling_rate, const char *features) |
Set the waveform and text as references for zero-shot voice synthesis. More... | |
int AILIA_API | ailiaVoiceInference (struct AILIAVoice *net, const char *utf8) |
Perform inference. More... | |
int AILIA_API | ailiaVoiceGetWaveInfo (struct AILIAVoice *net, unsigned int *samples, unsigned int *channels, unsigned int *sampling_rate) |
Gets the information of wave. More... | |
int AILIA_API | ailiaVoiceGetWave (struct AILIAVoice *net, float *buf, unsigned int buf_size) |
Gets the decoded features. More... | |
void AILIA_API | ailiaVoiceDestroy (struct AILIAVoice *net) |
It destroys the Voice instance. More... | |
const char *AILIA_API | ailiaVoiceGetErrorDetail (struct AILIAVoice *net) |
Returns the details of errors. More... | |
#define AILIA_API __stdcall |
#define AILIA_VOICE_API_CALLBACK_VERSION (2) |
Struct version.
#define AILIA_VOICE_CLEANER_TYPE_BASIC (0) |
BasicCleaner.
#define AILIA_VOICE_CLEANER_TYPE_ENGLISH (1) |
EnglishCleaner.
#define AILIA_VOICE_DICTIONARY_TYPE_G2P_EN (1) |
Format for G2P_EN.
#define AILIA_VOICE_DICTIONARY_TYPE_OPEN_JTALK (0) |
Format for OpenJTalk.
#define AILIA_VOICE_FLAG_NONE (0) |
Default flag.
#define AILIA_VOICE_G2P_TYPE_GPT_SOVITS_EN (1) |
GPT SOVITS English.
#define AILIA_VOICE_G2P_TYPE_GPT_SOVITS_JA (2) |
GPT SOVITS Japanese.
#define AILIA_VOICE_MODEL_TYPE_GPT_SOVITS (1) |
Format for GPT-SoVITS.
#define AILIA_VOICE_MODEL_TYPE_TACOTRON2 (0) |
Format for Tacotron2.
#define AILIA_VOICE_TEXT_POST_PROCESS_APPEND_PUNCTUATION (2) |
#define AILIA_VOICE_USER_API |
#define ailiaVoiceOpenDictionaryFile ailiaVoiceOpenDictionaryFileW |
#define ailiaVoiceOpenModelFile ailiaVoiceOpenModelFileW |
#define ailiaVoiceSetUserDictionaryFile ailiaVoiceSetUserDictionaryFileA |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_AUDIO_GET_RESAMPLE_LEN) (int *, int, int, int) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_AUDIO_RESAMPLE) (void *, const void *, int, int, int, int) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_COPY_BLOB_DATA) (struct AILIANetwork *dst_net, unsigned int dst_blob_idx, struct AILIANetwork *src_net, unsigned int src_blob_idx) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_CREATE) (struct AILIANetwork **, int, int) |
typedef void(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_DESTROY) (struct AILIANetwork *) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_GET_BLOB_DATA) (struct AILIANetwork *, void *, unsigned int, unsigned int) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_GET_BLOB_INDEX_BY_INPUT_INDEX) (struct AILIANetwork *, unsigned int *, unsigned int) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_GET_BLOB_INDEX_BY_OUTPUT_INDEX) (struct AILIANetwork *, unsigned int *, unsigned int) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_GET_BLOB_SHAPE) (struct AILIANetwork *, AILIAShape *, unsigned int, unsigned int) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_GET_INPUT_BLOB_COUNT) (struct AILIANetwork *, unsigned int *) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_GET_OUTPUT_BLOB_COUNT) (struct AILIANetwork *, unsigned int *) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_OPEN_WEIGHT_FILE_A) (struct AILIANetwork *, const char *) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_OPEN_WEIGHT_FILE_W) (struct AILIANetwork *, const wchar_t *) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_OPEN_WEIGHT_MEM) (struct AILIANetwork *, const void *, unsigned int) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_SET_INPUT_BLOB_DATA) (struct AILIANetwork *, const void *, unsigned int, unsigned int) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_SET_INPUT_BLOB_SHAPE) (struct AILIANetwork *, const AILIAShape *, unsigned int, unsigned int) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_SET_MEMORY_MODE) (struct AILIANetwork *, unsigned int) |
typedef int(AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_UPDATE) (struct AILIANetwork *) |
typedef struct _AILIAVoiceApiCallback AILIAVoiceApiCallback |
const typedef char* AILIA_VOICE_USER_API* AILIA_VOICE_USER_API_AILIA_GET_ERROR_DETAIL | ( | struct AILIANetwork * | ) |
int AILIA_API ailiaVoiceCreate | ( | struct AILIAVoice ** | net, |
int | env_id, | ||
int | num_thread, | ||
int | memory_mode, | ||
int | flags, | ||
AILIAVoiceApiCallback | callback, | ||
int | version | ||
) |
Creates a Voice instance.
net | A pointer to the Voice instance pointer |
env_id | The ID of the inference backend used for computation (obtained by ailiaGetEnvironment() ). It is selected automatically if AILIA_ENVIRONMENT_ID_AUTO is specified. |
num_thread | The upper limit on the number of threads (It is set automatically if AILIA_MULTITHREAD_AUTO |
memory_mode | The memory mode (AILIA_MEMORY_MODE_*) |
flag | OR of AILIA_VOICE_FLAG_* |
api_callback | The callback for ailia API |
version | AILIA_VOICE_API_CALLBACK_VERSION is specified.) |
Creates a Voice instance.
void AILIA_API ailiaVoiceDestroy | ( | struct AILIAVoice * | net | ) |
It destroys the Voice instance.
net | A Voice instance pointer |
int AILIA_API ailiaVoiceExtractFullContext | ( | struct AILIAVoice * | net, |
const char * | utf8 | ||
) |
Perform ExtractFullContext.
net | A Voice instance pointer |
text | Text (UTF8) |
Get the result with ailiaVoiceGetFeatures API.
const char* AILIA_API ailiaVoiceGetErrorDetail | ( | struct AILIAVoice * | net | ) |
Returns the details of errors.
net | The network instance pointer |
The return value does not have to be released. The string is valid until the next ailiaVoice API function is called.
int AILIA_API ailiaVoiceGetFeatureLength | ( | struct AILIAVoice * | net, |
unsigned int * | len | ||
) |
Gets the size of features. (Include null)
net | A Voice instance pointer |
len | The length of features |
int AILIA_API ailiaVoiceGetFeatures | ( | struct AILIAVoice * | net, |
char * | features, | ||
unsigned int | len | ||
) |
Gets the decoded features.
net | A Voice instance pointer |
features | Features(UTF8) |
len | The length of features |
If ailiaVoiceGraphemeToPhoneme() or ailiaVoiceExtractFullContext() is not run at all, the function returns AILIA_STATUS_INVALID_STATE .
int AILIA_API ailiaVoiceGetWave | ( | struct AILIAVoice * | net, |
float * | buf, | ||
unsigned int | buf_size | ||
) |
Gets the decoded features.
net | A Voice instance pointer |
buf | PCM Wave (Normalized by 0 - 1) |
buf_size | Buffer size (Byte unit) |
If ailiaVoiceInference() is not run at all, the function returns AILIA_STATUS_INVALID_STATE .
int AILIA_API ailiaVoiceGetWaveInfo | ( | struct AILIAVoice * | net, |
unsigned int * | samples, | ||
unsigned int * | channels, | ||
unsigned int * | sampling_rate | ||
) |
Gets the information of wave.
net | A Voice instance pointer |
samples | Number of samples (per channel) |
channels | Number of channels |
sampling_rate | Sampling rate |
int AILIA_API ailiaVoiceGraphemeToPhoneme | ( | struct AILIAVoice * | net, |
const char * | utf8, | ||
int | g2p_type | ||
) |
Perform g2p.
net | A Voice instance pointer |
text | Text(UTF8) |
g2p_type | AILIA_VOICE_G2P_TYPE_* |
Get the result with ailiaVoiceGetFeatures API.
int AILIA_API ailiaVoiceInference | ( | struct AILIAVoice * | net, |
const char * | utf8 | ||
) |
Perform inference.
net | A Voice instance pointer |
text | Text(UTF8) |
Get the result with ailiaVoiceGetWave API.
int AILIA_API ailiaVoiceOpenDictionaryFileA | ( | struct AILIAVoice * | net, |
const char * | dictionary_path, | ||
int | dictionary_type | ||
) |
Set dictionary into a network instance.
net | A network instance pointer |
dictionary_path | The path name to the dictionary folder (MBSC) |
dictionary_type | AILIA_VOICE_DICTIONARY_TYPE_* |
int AILIA_API ailiaVoiceOpenDictionaryFileW | ( | struct AILIAVoice * | net, |
const wchar_t * | dictionary_path, | ||
int | dictionary_type | ||
) |
Set dictionary into a network instance.
net | A network instance pointer |
dictionary_path | The path name to the dictionary folder (UTF16) |
dictionary_type | AILIA_VOICE_DICTIONARY_TYPE_* |
int AILIA_API ailiaVoiceOpenModelFileA | ( | struct AILIAVoice * | net, |
const char * | encoder, | ||
const char * | decoder1, | ||
const char * | decoder2, | ||
const char * | wave, | ||
const char * | ssl, | ||
int | model_type, | ||
int | cleaner_type | ||
) |
Set models into a network instance.
net | A network instance pointer |
encoder | The path name to the onnx file (MBSC) |
decoder1 | The path name to the onnx file (MBSC) |
decoder2 | The path name to the onnx file (MBSC) |
wave | The path name to the onnx file (MBSC) |
ssl | The path name to the onnx file (MBSC) |
model_type | AILIA_VOICE_MODEL_TYPE_* |
cleaner_type | AILIA_VOICE_CLEANER_TYPE_* |
int AILIA_API ailiaVoiceOpenModelFileW | ( | struct AILIAVoice * | net, |
const wchar_t * | encoder, | ||
const wchar_t * | decoder1, | ||
const wchar_t * | decoder2, | ||
const wchar_t * | wave, | ||
const wchar_t * | ssl, | ||
int | model_type, | ||
int | cleaner_type | ||
) |
Set models into a network instance.
net | A network instance pointer |
encoder | The path name to the onnx file (UTF16) |
decoder1 | The path name to the onnx file (UTF16) |
decoder2 | The path name to the onnx file (UTF16) |
wave | The path name to the onnx file (UTF16) |
ssl | The path name to the onnx file (UTF16) |
model_type | AILIA_VOICE_MODEL_TYPE_* |
cleaner_type | AILIA_VOICE_CLEANER_TYPE_* |
int AILIA_API ailiaVoiceSetReference | ( | struct AILIAVoice * | net, |
float * | buf, | ||
unsigned int | buf_size, | ||
unsigned int | channels, | ||
unsigned int | sampling_rate, | ||
const char * | features | ||
) |
Set the waveform and text as references for zero-shot voice synthesis.
net | A Voice instance pointer |
buf | PCM Wave (Normalized by 0 - 1) |
buf_size | buffer size (byte unit) |
channels | num channels |
sampling_rate | sampling rate |
features | Feature (UTF8) |
int AILIA_API ailiaVoiceSetUserDictionaryFileA | ( | struct AILIAVoice * | net, |
const char * | dictionary_path, | ||
int | dictionary_type | ||
) |
Set user dictionary into a network instance.
net | A network instance pointer |
dictionary_path | The path name to the user dictionary file (MBSC) |
dictionary_type | AILIA_VOICE_DICTIONARY_TYPE_* |
You need to call before ailiaVoiceOpenDictionaryFileA.
int AILIA_API ailiaVoiceSetUserDictionaryFileW | ( | struct AILIAVoice * | net, |
const wchar_t * | dictionary_path, | ||
int | dictionary_type | ||
) |
Set user dictionary into a network instance.
net | A network instance pointer |
dictionary_path | The path name to the user dictionary file (UTF16) |
dictionary_type | AILIA_VOICE_DICTIONARY_TYPE_* |
You need to call before ailiaVoiceOpenDictionaryFileW.