VoicevoxCore
Loading...
Searching...
No Matches
voicevox_core.h
Go to the documentation of this file.
1
69#ifndef VOICEVOX_CORE_INCLUDE_GUARD
70#define VOICEVOX_CORE_INCLUDE_GUARD
71
72/* Generated with cbindgen:0.28.0 */
73
74#ifdef __cplusplus
75#include <cstdint>
76#else // __cplusplus
77#include <stdbool.h>
78#include <stdint.h>
79#endif // __cplusplus
80
81//#define VOICEVOX_LINK_ONNXRUNTIME
82//#define VOICEVOX_LOAD_ONNXRUNTIME
83
84#if !(defined(VOICEVOX_LINK_ONNXRUNTIME) || defined(VOICEVOX_LOAD_ONNXRUNTIME))
85#error "either `VOICEVOX_LINK_ONNXRUNTIME` or `VOICEVOX_LOAD_ONNXRUNTIME` must be enabled"
86#endif
87
88#if defined(VOICEVOX_LINK_ONNXRUNTIME) && defined(VOICEVOX_LOAD_ONNXRUNTIME)
89#error "`VOICEVOX_LINK_ONNXRUNTIME` or `VOICEVOX_LOAD_ONNXRUNTIME` cannot be enabled at the same time"
90#endif
91
98#ifdef __cplusplus
99 : int32_t
100#endif // __cplusplus
101 {
114};
115#ifndef __cplusplus
116typedef int32_t VoicevoxAccelerationMode;
117#endif // __cplusplus
118
230#ifndef __cplusplus
231typedef int32_t VoicevoxResultCode;
232#endif // __cplusplus
233
265#ifndef __cplusplus
266typedef int32_t VoicevoxUserDictWordType;
267#endif // __cplusplus
268
289
306
315
322
332
333#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
351#endif
352
369
375typedef const uint8_t (*VoicevoxVoiceModelId)[16];
376
384typedef uint32_t VoicevoxStyleId;
385
397
409
437
438#ifdef __cplusplus
439extern "C" {
440#endif // __cplusplus
441
442#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
454#ifdef _WIN32
455__declspec(dllimport)
456#endif
458#endif
459
460#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
470#ifdef _WIN32
471__declspec(dllimport)
472#endif
474#endif
475
476#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
488#ifdef _WIN32
489__declspec(dllimport)
490#endif
492#endif
493
503#ifdef _WIN32
504__declspec(dllimport)
505#endif
507
508#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
530#ifdef _WIN32
531__declspec(dllimport)
532#endif
534 const struct VoicevoxOnnxruntime **out_onnxruntime);
535#endif
536
537#if defined(VOICEVOX_LINK_ONNXRUNTIME)
557#ifdef _WIN32
558__declspec(dllimport)
559#endif
561#endif
562
587#ifdef _WIN32
588__declspec(dllimport)
589#endif
590VoicevoxResultCode voicevox_open_jtalk_rc_new(const char *open_jtalk_dic_dir,
591 struct OpenJtalkRc **out_open_jtalk);
592
603#ifdef _WIN32
604__declspec(dllimport)
605#endif
607 const struct VoicevoxUserDict *user_dict);
608
620#ifdef _WIN32
621__declspec(dllimport)
622#endif
624 const char *text,
625 char **output_accent_phrases_json);
626
644#ifdef _WIN32
645__declspec(dllimport)
646#endif
648
655#ifdef _WIN32
656__declspec(dllimport)
657#endif
659
666#ifdef _WIN32
667__declspec(dllimport)
668#endif
669const char *voicevox_get_version(void);
670
686#ifdef _WIN32
687__declspec(dllimport)
688#endif
690 char **output_audio_query_json);
691
707#ifdef _WIN32
708__declspec(dllimport)
709#endif
711 struct VoicevoxVoiceModelFile **out_model);
712
725#ifdef _WIN32
726__declspec(dllimport)
727#endif
729 uint8_t (*output_voice_model_id)[16]);
730
742#ifdef _WIN32
743__declspec(dllimport)
744#endif
746
758#ifdef _WIN32
759__declspec(dllimport)
760#endif
762
780#ifdef _WIN32
781__declspec(dllimport)
782#endif
784 const struct OpenJtalkRc *open_jtalk,
785 struct VoicevoxInitializeOptions options,
786 struct VoicevoxSynthesizer **out_synthesizer);
787
799#ifdef _WIN32
800__declspec(dllimport)
801#endif
803
814#ifdef _WIN32
815__declspec(dllimport)
816#endif
818 const struct VoicevoxVoiceModelFile *model);
819
834#ifdef _WIN32
835__declspec(dllimport)
836#endif
838 VoicevoxVoiceModelId model_id);
839
849#ifdef _WIN32
850__declspec(dllimport)
851#endif
853
863#ifdef _WIN32
864__declspec(dllimport)
865#endif
867
882#ifdef _WIN32
883__declspec(dllimport)
884#endif
886 VoicevoxVoiceModelId model_id);
887
899#ifdef _WIN32
900__declspec(dllimport)
901#endif
903
930#ifdef _WIN32
931__declspec(dllimport)
932#endif
934 char **output_supported_devices_json);
935
964#ifdef _WIN32
965__declspec(dllimport)
966#endif
968 const char *kana,
969 VoicevoxStyleId style_id,
970 char **output_audio_query_json);
971
1005#ifdef _WIN32
1006__declspec(dllimport)
1007#endif
1009 const char *text,
1010 VoicevoxStyleId style_id,
1011 char **output_audio_query_json);
1012
1042#ifdef _WIN32
1043__declspec(dllimport)
1044#endif
1046 const char *kana,
1047 VoicevoxStyleId style_id,
1048 char **output_accent_phrases_json);
1049
1083#ifdef _WIN32
1084__declspec(dllimport)
1085#endif
1087 const char *text,
1088 VoicevoxStyleId style_id,
1089 char **output_accent_phrases_json);
1090
1115#ifdef _WIN32
1116__declspec(dllimport)
1117#endif
1119 const char *accent_phrases_json,
1120 VoicevoxStyleId style_id,
1121 char **output_accent_phrases_json);
1122
1142#ifdef _WIN32
1143__declspec(dllimport)
1144#endif
1146 const char *accent_phrases_json,
1147 VoicevoxStyleId style_id,
1148 char **output_accent_phrases_json);
1149
1169#ifdef _WIN32
1170__declspec(dllimport)
1171#endif
1173 const char *accent_phrases_json,
1174 VoicevoxStyleId style_id,
1175 char **output_accent_phrases_json);
1176
1183#ifdef _WIN32
1184__declspec(dllimport)
1185#endif
1187
1210#ifdef _WIN32
1211__declspec(dllimport)
1212#endif
1214 const char *audio_query_json,
1215 VoicevoxStyleId style_id,
1216 struct VoicevoxSynthesisOptions options,
1217 uintptr_t *output_wav_length,
1218 uint8_t **output_wav);
1219
1226#ifdef _WIN32
1227__declspec(dllimport)
1228#endif
1230
1253#ifdef _WIN32
1254__declspec(dllimport)
1255#endif
1257 const char *kana,
1258 VoicevoxStyleId style_id,
1259 struct VoicevoxTtsOptions options,
1260 uintptr_t *output_wav_length,
1261 uint8_t **output_wav);
1262
1290#ifdef _WIN32
1291__declspec(dllimport)
1292#endif
1294 const char *text,
1295 VoicevoxStyleId style_id,
1296 struct VoicevoxTtsOptions options,
1297 uintptr_t *output_wav_length,
1298 uint8_t **output_wav);
1299
1325#ifdef _WIN32
1326__declspec(dllimport)
1327#endif
1328void voicevox_json_free(char *json);
1329
1345#ifdef _WIN32
1346__declspec(dllimport)
1347#endif
1348void voicevox_wav_free(uint8_t *wav);
1349
1374#ifdef _WIN32
1375__declspec(dllimport)
1376#endif
1378
1389#ifdef _WIN32
1390__declspec(dllimport)
1391#endif
1393 const char *pronunciation,
1394 uintptr_t accent_type);
1395
1403#ifdef _WIN32
1404__declspec(dllimport)
1405#endif
1407
1421#ifdef _WIN32
1422__declspec(dllimport)
1423#endif
1425 const char *dict_path);
1426
1445#ifdef _WIN32
1446__declspec(dllimport)
1447#endif
1449 const struct VoicevoxUserDictWord *word,
1450 uint8_t (*output_word_uuid)[16]);
1451
1467#ifdef _WIN32
1468__declspec(dllimport)
1469#endif
1471 const uint8_t (*word_uuid)[16],
1472 const struct VoicevoxUserDictWord *word);
1473
1487#ifdef _WIN32
1488__declspec(dllimport)
1489#endif
1491 const uint8_t (*word_uuid)[16]);
1492
1508#ifdef _WIN32
1509__declspec(dllimport)
1510#endif
1512 char **output_json);
1513
1523#ifdef _WIN32
1524__declspec(dllimport)
1525#endif
1527 const struct VoicevoxUserDict *other_dict);
1528
1541#ifdef _WIN32
1542__declspec(dllimport)
1543#endif
1545 const char *path);
1546
1558#ifdef _WIN32
1559__declspec(dllimport)
1560#endif
1562
1563#ifdef __cplusplus
1564} // extern "C"
1565#endif // __cplusplus
1566
1567#endif /* VOICEVOX_CORE_INCLUDE_GUARD */
Definition voicevox_core.h:358
uint16_t cpu_num_threads
Definition voicevox_core.h:367
VoicevoxAccelerationMode acceleration_mode
Definition voicevox_core.h:362
Definition voicevox_core.h:343
const char * filename
Definition voicevox_core.h:349
Definition voicevox_core.h:391
bool enable_interrogative_upspeak
Definition voicevox_core.h:395
Definition voicevox_core.h:403
bool enable_interrogative_upspeak
Definition voicevox_core.h:407
Definition voicevox_core.h:415
VoicevoxUserDictWordType word_type
Definition voicevox_core.h:431
uint32_t priority
Definition voicevox_core.h:435
const char * surface
Definition voicevox_core.h:419
uintptr_t accent_type
Definition voicevox_core.h:427
const char * pronunciation
Definition voicevox_core.h:423
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:384
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:288
VoicevoxUserDictWordType
Definition voicevox_core.h:243
@ VOICEVOX_USER_DICT_WORD_TYPE_ADJECTIVE
Definition voicevox_core.h:259
@ VOICEVOX_USER_DICT_WORD_TYPE_SUFFIX
Definition voicevox_core.h:263
@ VOICEVOX_USER_DICT_WORD_TYPE_PROPER_NOUN
Definition voicevox_core.h:247
@ VOICEVOX_USER_DICT_WORD_TYPE_VERB
Definition voicevox_core.h:255
@ VOICEVOX_USER_DICT_WORD_TYPE_COMMON_NOUN
Definition voicevox_core.h:251
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:375
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:331
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:128
@ VOICEVOX_RESULT_RUN_MODEL_ERROR
Definition voicevox_core.h:160
@ VOICEVOX_RESULT_USER_DICT_WORD_NOT_FOUND_ERROR
Definition voicevox_core.h:216
@ VOICEVOX_RESULT_USE_USER_DICT_ERROR
Definition voicevox_core.h:220
@ VOICEVOX_RESULT_GPU_SUPPORT_ERROR
Definition voicevox_core.h:144
@ VOICEVOX_RESULT_INVALID_USER_DICT_WORD_ERROR
Definition voicevox_core.h:224
@ VOICEVOX_RESULT_INVALID_UUID_ERROR
Definition voicevox_core.h:228
@ VOICEVOX_RESULT_INVALID_ACCENT_PHRASE_ERROR
Definition voicevox_core.h:180
@ VOICEVOX_RESULT_ANALYZE_TEXT_ERROR
Definition voicevox_core.h:164
@ VOICEVOX_RESULT_MODEL_ALREADY_LOADED_ERROR
Definition voicevox_core.h:196
@ VOICEVOX_RESULT_INIT_INFERENCE_RUNTIME_ERROR
Definition voicevox_core.h:148
@ VOICEVOX_RESULT_NOT_LOADED_OPENJTALK_DICT_ERROR
Definition voicevox_core.h:136
@ VOICEVOX_RESULT_INVALID_AUDIO_QUERY_ERROR
Definition voicevox_core.h:176
@ VOICEVOX_RESULT_SAVE_USER_DICT_ERROR
Definition voicevox_core.h:212
@ VOICEVOX_RESULT_INVALID_MODEL_DATA_ERROR
Definition voicevox_core.h:204
@ VOICEVOX_RESULT_OPEN_ZIP_FILE_ERROR
Definition voicevox_core.h:184
@ VOICEVOX_RESULT_OK
Definition voicevox_core.h:132
@ VOICEVOX_RESULT_PARSE_KANA_ERROR
Definition voicevox_core.h:172
@ VOICEVOX_RESULT_STYLE_NOT_FOUND_ERROR
Definition voicevox_core.h:152
@ VOICEVOX_RESULT_GET_SUPPORTED_DEVICES_ERROR
Definition voicevox_core.h:140
@ VOICEVOX_RESULT_STYLE_ALREADY_LOADED_ERROR
Definition voicevox_core.h:200
@ VOICEVOX_RESULT_LOAD_USER_DICT_ERROR
Definition voicevox_core.h:208
@ VOICEVOX_RESULT_MODEL_NOT_FOUND_ERROR
Definition voicevox_core.h:156
@ VOICEVOX_RESULT_READ_ZIP_ENTRY_ERROR
Definition voicevox_core.h:188
@ VOICEVOX_RESULT_INVALID_MODEL_HEADER_ERROR
Definition voicevox_core.h:192
@ VOICEVOX_RESULT_INVALID_UTF8_INPUT_ERROR
Definition voicevox_core.h:168
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:101
@ VOICEVOX_ACCELERATION_MODE_GPU
Definition voicevox_core.h:113
@ VOICEVOX_ACCELERATION_MODE_AUTO
Definition voicevox_core.h:105
@ VOICEVOX_ACCELERATION_MODE_CPU
Definition voicevox_core.h:109
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:314
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:321
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:305
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)