VoicevoxCore
Loading...
Searching...
No Matches
voicevox_core.h
Go to the documentation of this file.
1
57#ifndef VOICEVOX_CORE_INCLUDE_GUARD
58#define VOICEVOX_CORE_INCLUDE_GUARD
59
60/* Generated with cbindgen:0.27.0 */
61
62#ifdef __cplusplus
63#include <cstdint>
64#else // __cplusplus
65#include <stdbool.h>
66#include <stdint.h>
67#endif // __cplusplus
68
69//#define VOICEVOX_LINK_ONNXRUNTIME
70//#define VOICEVOX_LOAD_ONNXRUNTIME
71
72#if !(defined(VOICEVOX_LINK_ONNXRUNTIME) || defined(VOICEVOX_LOAD_ONNXRUNTIME))
73#error "either `VOICEVOX_LINK_ONNXRUNTIME` or `VOICEVOX_LOAD_ONNXRUNTIME` must be enabled"
74#endif
75
76#if defined(VOICEVOX_LINK_ONNXRUNTIME) && defined(VOICEVOX_LOAD_ONNXRUNTIME)
77#error "`VOICEVOX_LINK_ONNXRUNTIME` or `VOICEVOX_LOAD_ONNXRUNTIME` cannot be enabled at the same time"
78#endif
79
86#ifdef __cplusplus
87 : int32_t
88#endif // __cplusplus
89 {
102};
103#ifndef __cplusplus
104typedef int32_t VoicevoxAccelerationMode;
105#endif // __cplusplus
106
218#ifndef __cplusplus
219typedef int32_t VoicevoxResultCode;
220#endif // __cplusplus
221
253#ifndef __cplusplus
254typedef int32_t VoicevoxUserDictWordType;
255#endif // __cplusplus
256
277
294
303
310
320
321#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
339#endif
340
357
363typedef const uint8_t (*VoicevoxVoiceModelId)[16];
364
372typedef uint32_t VoicevoxStyleId;
373
385
397
425
426#ifdef __cplusplus
427extern "C" {
428#endif // __cplusplus
429
430#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
442#ifdef _WIN32
443__declspec(dllimport)
444#endif
446#endif
447
448#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
458#ifdef _WIN32
459__declspec(dllimport)
460#endif
462#endif
463
464#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
476#ifdef _WIN32
477__declspec(dllimport)
478#endif
480#endif
481
491#ifdef _WIN32
492__declspec(dllimport)
493#endif
495
496#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
518#ifdef _WIN32
519__declspec(dllimport)
520#endif
522 const struct VoicevoxOnnxruntime **out_onnxruntime);
523#endif
524
525#if defined(VOICEVOX_LINK_ONNXRUNTIME)
545#ifdef _WIN32
546__declspec(dllimport)
547#endif
549#endif
550
575#ifdef _WIN32
576__declspec(dllimport)
577#endif
578VoicevoxResultCode voicevox_open_jtalk_rc_new(const char *open_jtalk_dic_dir,
579 struct OpenJtalkRc **out_open_jtalk);
580
591#ifdef _WIN32
592__declspec(dllimport)
593#endif
595 const struct VoicevoxUserDict *user_dict);
596
608#ifdef _WIN32
609__declspec(dllimport)
610#endif
612 const char *text,
613 char **output_accent_phrases_json);
614
632#ifdef _WIN32
633__declspec(dllimport)
634#endif
636
643#ifdef _WIN32
644__declspec(dllimport)
645#endif
647
654#ifdef _WIN32
655__declspec(dllimport)
656#endif
657const char *voicevox_get_version(void);
658
674#ifdef _WIN32
675__declspec(dllimport)
676#endif
678 char **output_audio_query_json);
679
695#ifdef _WIN32
696__declspec(dllimport)
697#endif
699 struct VoicevoxVoiceModelFile **out_model);
700
713#ifdef _WIN32
714__declspec(dllimport)
715#endif
717 uint8_t (*output_voice_model_id)[16]);
718
730#ifdef _WIN32
731__declspec(dllimport)
732#endif
734
746#ifdef _WIN32
747__declspec(dllimport)
748#endif
750
768#ifdef _WIN32
769__declspec(dllimport)
770#endif
772 const struct OpenJtalkRc *open_jtalk,
773 struct VoicevoxInitializeOptions options,
774 struct VoicevoxSynthesizer **out_synthesizer);
775
787#ifdef _WIN32
788__declspec(dllimport)
789#endif
791
802#ifdef _WIN32
803__declspec(dllimport)
804#endif
806 const struct VoicevoxVoiceModelFile *model);
807
822#ifdef _WIN32
823__declspec(dllimport)
824#endif
826 VoicevoxVoiceModelId model_id);
827
837#ifdef _WIN32
838__declspec(dllimport)
839#endif
841
851#ifdef _WIN32
852__declspec(dllimport)
853#endif
855
870#ifdef _WIN32
871__declspec(dllimport)
872#endif
874 VoicevoxVoiceModelId model_id);
875
887#ifdef _WIN32
888__declspec(dllimport)
889#endif
891
918#ifdef _WIN32
919__declspec(dllimport)
920#endif
922 char **output_supported_devices_json);
923
952#ifdef _WIN32
953__declspec(dllimport)
954#endif
956 const char *kana,
957 VoicevoxStyleId style_id,
958 char **output_audio_query_json);
959
993#ifdef _WIN32
994__declspec(dllimport)
995#endif
997 const char *text,
998 VoicevoxStyleId style_id,
999 char **output_audio_query_json);
1000
1030#ifdef _WIN32
1031__declspec(dllimport)
1032#endif
1034 const char *kana,
1035 VoicevoxStyleId style_id,
1036 char **output_accent_phrases_json);
1037
1071#ifdef _WIN32
1072__declspec(dllimport)
1073#endif
1075 const char *text,
1076 VoicevoxStyleId style_id,
1077 char **output_accent_phrases_json);
1078
1103#ifdef _WIN32
1104__declspec(dllimport)
1105#endif
1107 const char *accent_phrases_json,
1108 VoicevoxStyleId style_id,
1109 char **output_accent_phrases_json);
1110
1130#ifdef _WIN32
1131__declspec(dllimport)
1132#endif
1134 const char *accent_phrases_json,
1135 VoicevoxStyleId style_id,
1136 char **output_accent_phrases_json);
1137
1157#ifdef _WIN32
1158__declspec(dllimport)
1159#endif
1161 const char *accent_phrases_json,
1162 VoicevoxStyleId style_id,
1163 char **output_accent_phrases_json);
1164
1171#ifdef _WIN32
1172__declspec(dllimport)
1173#endif
1175
1198#ifdef _WIN32
1199__declspec(dllimport)
1200#endif
1202 const char *audio_query_json,
1203 VoicevoxStyleId style_id,
1204 struct VoicevoxSynthesisOptions options,
1205 uintptr_t *output_wav_length,
1206 uint8_t **output_wav);
1207
1214#ifdef _WIN32
1215__declspec(dllimport)
1216#endif
1218
1241#ifdef _WIN32
1242__declspec(dllimport)
1243#endif
1245 const char *kana,
1246 VoicevoxStyleId style_id,
1247 struct VoicevoxTtsOptions options,
1248 uintptr_t *output_wav_length,
1249 uint8_t **output_wav);
1250
1278#ifdef _WIN32
1279__declspec(dllimport)
1280#endif
1282 const char *text,
1283 VoicevoxStyleId style_id,
1284 struct VoicevoxTtsOptions options,
1285 uintptr_t *output_wav_length,
1286 uint8_t **output_wav);
1287
1313#ifdef _WIN32
1314__declspec(dllimport)
1315#endif
1316void voicevox_json_free(char *json);
1317
1333#ifdef _WIN32
1334__declspec(dllimport)
1335#endif
1336void voicevox_wav_free(uint8_t *wav);
1337
1362#ifdef _WIN32
1363__declspec(dllimport)
1364#endif
1366
1377#ifdef _WIN32
1378__declspec(dllimport)
1379#endif
1381 const char *pronunciation,
1382 uintptr_t accent_type);
1383
1391#ifdef _WIN32
1392__declspec(dllimport)
1393#endif
1395
1409#ifdef _WIN32
1410__declspec(dllimport)
1411#endif
1413 const char *dict_path);
1414
1433#ifdef _WIN32
1434__declspec(dllimport)
1435#endif
1437 const struct VoicevoxUserDictWord *word,
1438 uint8_t (*output_word_uuid)[16]);
1439
1455#ifdef _WIN32
1456__declspec(dllimport)
1457#endif
1459 const uint8_t (*word_uuid)[16],
1460 const struct VoicevoxUserDictWord *word);
1461
1475#ifdef _WIN32
1476__declspec(dllimport)
1477#endif
1479 const uint8_t (*word_uuid)[16]);
1480
1496#ifdef _WIN32
1497__declspec(dllimport)
1498#endif
1500 char **output_json);
1501
1511#ifdef _WIN32
1512__declspec(dllimport)
1513#endif
1515 const struct VoicevoxUserDict *other_dict);
1516
1529#ifdef _WIN32
1530__declspec(dllimport)
1531#endif
1533 const char *path);
1534
1546#ifdef _WIN32
1547__declspec(dllimport)
1548#endif
1550
1551#ifdef __cplusplus
1552} // extern "C"
1553#endif // __cplusplus
1554
1555#endif /* VOICEVOX_CORE_INCLUDE_GUARD */
Definition voicevox_core.h:346
uint16_t cpu_num_threads
Definition voicevox_core.h:355
VoicevoxAccelerationMode acceleration_mode
Definition voicevox_core.h:350
Definition voicevox_core.h:331
const char * filename
Definition voicevox_core.h:337
Definition voicevox_core.h:379
bool enable_interrogative_upspeak
Definition voicevox_core.h:383
Definition voicevox_core.h:391
bool enable_interrogative_upspeak
Definition voicevox_core.h:395
Definition voicevox_core.h:403
VoicevoxUserDictWordType word_type
Definition voicevox_core.h:419
uint32_t priority
Definition voicevox_core.h:423
const char * surface
Definition voicevox_core.h:407
uintptr_t accent_type
Definition voicevox_core.h:415
const char * pronunciation
Definition voicevox_core.h:411
void voicevox_open_jtalk_rc_delete(struct OpenJtalkRc *open_jtalk)
VoicevoxResultCode voicevox_synthesizer_create_accent_phrases(const struct VoicevoxSynthesizer *synthesizer, const char *text, VoicevoxStyleId style_id, char **output_accent_phrases_json)
VoicevoxResultCode voicevox_synthesizer_replace_mora_data(const struct VoicevoxSynthesizer *synthesizer, const char *accent_phrases_json, VoicevoxStyleId style_id, char **output_accent_phrases_json)
VoicevoxResultCode voicevox_synthesizer_create_audio_query(const struct VoicevoxSynthesizer *synthesizer, const char *text, VoicevoxStyleId style_id, char **output_audio_query_json)
uint32_t VoicevoxStyleId
Definition voicevox_core.h:372
VoicevoxResultCode voicevox_user_dict_save(const struct VoicevoxUserDict *user_dict, const char *path)
void voicevox_voice_model_file_id(const struct VoicevoxVoiceModelFile *model, uint8_t(*output_voice_model_id)[16])
struct OpenJtalkRc OpenJtalkRc
Definition voicevox_core.h:276
VoicevoxUserDictWordType
Definition voicevox_core.h:231
@ VOICEVOX_USER_DICT_WORD_TYPE_ADJECTIVE
Definition voicevox_core.h:247
@ VOICEVOX_USER_DICT_WORD_TYPE_SUFFIX
Definition voicevox_core.h:251
@ VOICEVOX_USER_DICT_WORD_TYPE_PROPER_NOUN
Definition voicevox_core.h:235
@ VOICEVOX_USER_DICT_WORD_TYPE_VERB
Definition voicevox_core.h:243
@ VOICEVOX_USER_DICT_WORD_TYPE_COMMON_NOUN
Definition voicevox_core.h:239
VoicevoxResultCode voicevox_onnxruntime_create_supported_devices_json(const struct VoicevoxOnnxruntime *onnxruntime, char **output_supported_devices_json)
VoicevoxResultCode voicevox_synthesizer_unload_voice_model(const struct VoicevoxSynthesizer *synthesizer, VoicevoxVoiceModelId model_id)
char * voicevox_synthesizer_create_metas_json(const struct VoicevoxSynthesizer *synthesizer)
VoicevoxResultCode voicevox_audio_query_create_from_accent_phrases(const char *accent_phrases_json, char **output_audio_query_json)
VoicevoxResultCode voicevox_synthesizer_load_voice_model(const struct VoicevoxSynthesizer *synthesizer, const struct VoicevoxVoiceModelFile *model)
VoicevoxResultCode voicevox_synthesizer_tts(const struct VoicevoxSynthesizer *synthesizer, const char *text, VoicevoxStyleId style_id, struct VoicevoxTtsOptions options, uintptr_t *output_wav_length, uint8_t **output_wav)
VoicevoxResultCode voicevox_open_jtalk_rc_new(const char *open_jtalk_dic_dir, struct OpenJtalkRc **out_open_jtalk)
const uint8_t(* VoicevoxVoiceModelId)[16]
Definition voicevox_core.h:363
VoicevoxResultCode voicevox_synthesizer_create_accent_phrases_from_kana(const struct VoicevoxSynthesizer *synthesizer, const char *kana, VoicevoxStyleId style_id, char **output_accent_phrases_json)
VoicevoxResultCode voicevox_synthesizer_new(const struct VoicevoxOnnxruntime *onnxruntime, const struct OpenJtalkRc *open_jtalk, struct VoicevoxInitializeOptions options, struct VoicevoxSynthesizer **out_synthesizer)
void voicevox_voice_model_file_delete(struct VoicevoxVoiceModelFile *model)
void voicevox_json_free(char *json)
struct VoicevoxSynthesisOptions voicevox_make_default_synthesis_options(void)
VoicevoxResultCode voicevox_onnxruntime_load_once(struct VoicevoxLoadOnnxruntimeOptions options, const struct VoicevoxOnnxruntime **out_onnxruntime)
struct VoicevoxVoiceModelFile VoicevoxVoiceModelFile
Definition voicevox_core.h:319
const struct VoicevoxOnnxruntime * voicevox_onnxruntime_get(void)
VoicevoxResultCode voicevox_synthesizer_synthesis(const struct VoicevoxSynthesizer *synthesizer, const char *audio_query_json, VoicevoxStyleId style_id, struct VoicevoxSynthesisOptions options, uintptr_t *output_wav_length, uint8_t **output_wav)
const char * voicevox_get_onnxruntime_lib_unversioned_filename(void)
VoicevoxResultCode
Definition voicevox_core.h:116
@ VOICEVOX_RESULT_RUN_MODEL_ERROR
Definition voicevox_core.h:148
@ VOICEVOX_RESULT_USER_DICT_WORD_NOT_FOUND_ERROR
Definition voicevox_core.h:204
@ VOICEVOX_RESULT_USE_USER_DICT_ERROR
Definition voicevox_core.h:208
@ VOICEVOX_RESULT_GPU_SUPPORT_ERROR
Definition voicevox_core.h:132
@ VOICEVOX_RESULT_INVALID_USER_DICT_WORD_ERROR
Definition voicevox_core.h:212
@ VOICEVOX_RESULT_INVALID_UUID_ERROR
Definition voicevox_core.h:216
@ VOICEVOX_RESULT_INVALID_ACCENT_PHRASE_ERROR
Definition voicevox_core.h:168
@ VOICEVOX_RESULT_ANALYZE_TEXT_ERROR
Definition voicevox_core.h:152
@ VOICEVOX_RESULT_MODEL_ALREADY_LOADED_ERROR
Definition voicevox_core.h:184
@ VOICEVOX_RESULT_INIT_INFERENCE_RUNTIME_ERROR
Definition voicevox_core.h:136
@ VOICEVOX_RESULT_NOT_LOADED_OPENJTALK_DICT_ERROR
Definition voicevox_core.h:124
@ VOICEVOX_RESULT_INVALID_AUDIO_QUERY_ERROR
Definition voicevox_core.h:164
@ VOICEVOX_RESULT_SAVE_USER_DICT_ERROR
Definition voicevox_core.h:200
@ VOICEVOX_RESULT_INVALID_MODEL_DATA_ERROR
Definition voicevox_core.h:192
@ VOICEVOX_RESULT_OPEN_ZIP_FILE_ERROR
Definition voicevox_core.h:172
@ VOICEVOX_RESULT_OK
Definition voicevox_core.h:120
@ VOICEVOX_RESULT_PARSE_KANA_ERROR
Definition voicevox_core.h:160
@ VOICEVOX_RESULT_STYLE_NOT_FOUND_ERROR
Definition voicevox_core.h:140
@ VOICEVOX_RESULT_GET_SUPPORTED_DEVICES_ERROR
Definition voicevox_core.h:128
@ VOICEVOX_RESULT_STYLE_ALREADY_LOADED_ERROR
Definition voicevox_core.h:188
@ VOICEVOX_RESULT_LOAD_USER_DICT_ERROR
Definition voicevox_core.h:196
@ VOICEVOX_RESULT_MODEL_NOT_FOUND_ERROR
Definition voicevox_core.h:144
@ VOICEVOX_RESULT_READ_ZIP_ENTRY_ERROR
Definition voicevox_core.h:176
@ VOICEVOX_RESULT_INVALID_MODEL_HEADER_ERROR
Definition voicevox_core.h:180
@ VOICEVOX_RESULT_INVALID_UTF8_INPUT_ERROR
Definition voicevox_core.h:156
struct VoicevoxTtsOptions voicevox_make_default_tts_options(void)
VoicevoxResultCode voicevox_user_dict_to_json(const struct VoicevoxUserDict *user_dict, char **output_json)
VoicevoxAccelerationMode
Definition voicevox_core.h:89
@ VOICEVOX_ACCELERATION_MODE_GPU
Definition voicevox_core.h:101
@ VOICEVOX_ACCELERATION_MODE_AUTO
Definition voicevox_core.h:93
@ VOICEVOX_ACCELERATION_MODE_CPU
Definition voicevox_core.h:97
const char * voicevox_error_result_to_message(VoicevoxResultCode result_code)
VoicevoxResultCode voicevox_open_jtalk_rc_use_user_dict(const struct OpenJtalkRc *open_jtalk, const struct VoicevoxUserDict *user_dict)
bool voicevox_synthesizer_is_loaded_voice_model(const struct VoicevoxSynthesizer *synthesizer, VoicevoxVoiceModelId model_id)
VoicevoxResultCode voicevox_synthesizer_tts_from_kana(const struct VoicevoxSynthesizer *synthesizer, const char *kana, VoicevoxStyleId style_id, struct VoicevoxTtsOptions options, uintptr_t *output_wav_length, uint8_t **output_wav)
VoicevoxResultCode voicevox_user_dict_update_word(const struct VoicevoxUserDict *user_dict, const uint8_t(*word_uuid)[16], const struct VoicevoxUserDictWord *word)
struct VoicevoxSynthesizer VoicevoxSynthesizer
Definition voicevox_core.h:302
bool voicevox_synthesizer_is_gpu_mode(const struct VoicevoxSynthesizer *synthesizer)
char * voicevox_voice_model_file_create_metas_json(const struct VoicevoxVoiceModelFile *model)
VoicevoxResultCode voicevox_open_jtalk_rc_analyze(const struct OpenJtalkRc *open_jtalk, const char *text, char **output_accent_phrases_json)
struct VoicevoxUserDict VoicevoxUserDict
Definition voicevox_core.h:309
void voicevox_synthesizer_delete(struct VoicevoxSynthesizer *synthesizer)
VoicevoxResultCode voicevox_synthesizer_create_audio_query_from_kana(const struct VoicevoxSynthesizer *synthesizer, const char *kana, VoicevoxStyleId style_id, char **output_audio_query_json)
void voicevox_wav_free(uint8_t *wav)
const char * voicevox_get_version(void)
struct VoicevoxUserDict * voicevox_user_dict_new(void)
VoicevoxResultCode voicevox_user_dict_remove_word(const struct VoicevoxUserDict *user_dict, const uint8_t(*word_uuid)[16])
const struct VoicevoxOnnxruntime * voicevox_synthesizer_get_onnxruntime(const struct VoicevoxSynthesizer *synthesizer)
struct VoicevoxOnnxruntime VoicevoxOnnxruntime
Definition voicevox_core.h:293
const char * voicevox_get_onnxruntime_lib_versioned_filename(void)
struct VoicevoxUserDictWord voicevox_user_dict_word_make(const char *surface, const char *pronunciation, uintptr_t accent_type)
VoicevoxResultCode voicevox_onnxruntime_init_once(const struct VoicevoxOnnxruntime **out_onnxruntime)
VoicevoxResultCode voicevox_voice_model_file_open(const char *path, struct VoicevoxVoiceModelFile **out_model)
VoicevoxResultCode voicevox_user_dict_add_word(const struct VoicevoxUserDict *user_dict, const struct VoicevoxUserDictWord *word, uint8_t(*output_word_uuid)[16])
VoicevoxResultCode voicevox_user_dict_load(const struct VoicevoxUserDict *user_dict, const char *dict_path)
VoicevoxResultCode voicevox_user_dict_import(const struct VoicevoxUserDict *user_dict, const struct VoicevoxUserDict *other_dict)
void voicevox_user_dict_delete(struct VoicevoxUserDict *user_dict)
struct VoicevoxInitializeOptions voicevox_make_default_initialize_options(void)
VoicevoxResultCode voicevox_synthesizer_replace_mora_pitch(const struct VoicevoxSynthesizer *synthesizer, const char *accent_phrases_json, VoicevoxStyleId style_id, char **output_accent_phrases_json)
struct VoicevoxLoadOnnxruntimeOptions voicevox_make_default_load_onnxruntime_options(void)
VoicevoxResultCode voicevox_synthesizer_replace_phoneme_length(const struct VoicevoxSynthesizer *synthesizer, const char *accent_phrases_json, VoicevoxStyleId style_id, char **output_accent_phrases_json)