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
84#ifdef __cplusplus
85 : int32_t
86#endif // __cplusplus
87 {
100};
101#ifndef __cplusplus
102typedef int32_t VoicevoxAccelerationMode;
103#endif // __cplusplus
104
214#ifndef __cplusplus
215typedef int32_t VoicevoxResultCode;
216#endif // __cplusplus
217
247#ifndef __cplusplus
248typedef int32_t VoicevoxUserDictWordType;
249#endif // __cplusplus
250
269
284
291
296
304
305#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
321#endif
322
337
341typedef const uint8_t (*VoicevoxVoiceModelId)[16];
342
348typedef uint32_t VoicevoxStyleId;
349
359
369
395
396#ifdef __cplusplus
397extern "C" {
398#endif // __cplusplus
399
400#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
410#ifdef _WIN32
411__declspec(dllimport)
412#endif
414#endif
415
416#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
424#ifdef _WIN32
425__declspec(dllimport)
426#endif
428#endif
429
430#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
440#ifdef _WIN32
441__declspec(dllimport)
442#endif
444#endif
445
453#ifdef _WIN32
454__declspec(dllimport)
455#endif
457
458#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
478#ifdef _WIN32
479__declspec(dllimport)
480#endif
482 const struct VoicevoxOnnxruntime **out_onnxruntime);
483#endif
484
485#if defined(VOICEVOX_LINK_ONNXRUNTIME)
503#ifdef _WIN32
504__declspec(dllimport)
505#endif
507#endif
508
531#ifdef _WIN32
532__declspec(dllimport)
533#endif
534VoicevoxResultCode voicevox_open_jtalk_rc_new(const char *open_jtalk_dic_dir,
535 struct OpenJtalkRc **out_open_jtalk);
536
545#ifdef _WIN32
546__declspec(dllimport)
547#endif
549 const struct VoicevoxUserDict *user_dict);
550
566#ifdef _WIN32
567__declspec(dllimport)
568#endif
570
575#ifdef _WIN32
576__declspec(dllimport)
577#endif
579
584#ifdef _WIN32
585__declspec(dllimport)
586#endif
587const char *voicevox_get_version(void);
588
602#ifdef _WIN32
603__declspec(dllimport)
604#endif
606 struct VoicevoxVoiceModelFile **out_model);
607
618#ifdef _WIN32
619__declspec(dllimport)
620#endif
622 uint8_t (*output_voice_model_id)[16]);
623
633#ifdef _WIN32
634__declspec(dllimport)
635#endif
637
647#ifdef _WIN32
648__declspec(dllimport)
649#endif
651
667#ifdef _WIN32
668__declspec(dllimport)
669#endif
671 const struct OpenJtalkRc *open_jtalk,
672 struct VoicevoxInitializeOptions options,
673 struct VoicevoxSynthesizer **out_synthesizer);
674
684#ifdef _WIN32
685__declspec(dllimport)
686#endif
688
697#ifdef _WIN32
698__declspec(dllimport)
699#endif
701 const struct VoicevoxVoiceModelFile *model);
702
715#ifdef _WIN32
716__declspec(dllimport)
717#endif
719 VoicevoxVoiceModelId model_id);
720
728#ifdef _WIN32
729__declspec(dllimport)
730#endif
732
740#ifdef _WIN32
741__declspec(dllimport)
742#endif
744
757#ifdef _WIN32
758__declspec(dllimport)
759#endif
761 VoicevoxVoiceModelId model_id);
762
772#ifdef _WIN32
773__declspec(dllimport)
774#endif
776
801#ifdef _WIN32
802__declspec(dllimport)
803#endif
805 char **output_supported_devices_json);
806
833#ifdef _WIN32
834__declspec(dllimport)
835#endif
837 const char *kana,
838 VoicevoxStyleId style_id,
839 char **output_audio_query_json);
840
867#ifdef _WIN32
868__declspec(dllimport)
869#endif
871 const char *text,
872 VoicevoxStyleId style_id,
873 char **output_audio_query_json);
874
902#ifdef _WIN32
903__declspec(dllimport)
904#endif
906 const char *kana,
907 VoicevoxStyleId style_id,
908 char **output_accent_phrases_json);
909
936#ifdef _WIN32
937__declspec(dllimport)
938#endif
940 const char *text,
941 VoicevoxStyleId style_id,
942 char **output_accent_phrases_json);
943
961#ifdef _WIN32
962__declspec(dllimport)
963#endif
965 const char *accent_phrases_json,
966 VoicevoxStyleId style_id,
967 char **output_accent_phrases_json);
968
986#ifdef _WIN32
987__declspec(dllimport)
988#endif
990 const char *accent_phrases_json,
991 VoicevoxStyleId style_id,
992 char **output_accent_phrases_json);
993
1011#ifdef _WIN32
1012__declspec(dllimport)
1013#endif
1015 const char *accent_phrases_json,
1016 VoicevoxStyleId style_id,
1017 char **output_accent_phrases_json);
1018
1023#ifdef _WIN32
1024__declspec(dllimport)
1025#endif
1027
1048#ifdef _WIN32
1049__declspec(dllimport)
1050#endif
1052 const char *audio_query_json,
1053 VoicevoxStyleId style_id,
1054 struct VoicevoxSynthesisOptions options,
1055 uintptr_t *output_wav_length,
1056 uint8_t **output_wav);
1057
1062#ifdef _WIN32
1063__declspec(dllimport)
1064#endif
1066
1087#ifdef _WIN32
1088__declspec(dllimport)
1089#endif
1091 const char *kana,
1092 VoicevoxStyleId style_id,
1093 struct VoicevoxTtsOptions options,
1094 uintptr_t *output_wav_length,
1095 uint8_t **output_wav);
1096
1117#ifdef _WIN32
1118__declspec(dllimport)
1119#endif
1121 const char *text,
1122 VoicevoxStyleId style_id,
1123 struct VoicevoxTtsOptions options,
1124 uintptr_t *output_wav_length,
1125 uint8_t **output_wav);
1126
1148#ifdef _WIN32
1149__declspec(dllimport)
1150#endif
1151void voicevox_json_free(char *json);
1152
1166#ifdef _WIN32
1167__declspec(dllimport)
1168#endif
1169void voicevox_wav_free(uint8_t *wav);
1170
1193#ifdef _WIN32
1194__declspec(dllimport)
1195#endif
1197
1205#ifdef _WIN32
1206__declspec(dllimport)
1207#endif
1209 const char *pronunciation);
1210
1216#ifdef _WIN32
1217__declspec(dllimport)
1218#endif
1220
1232#ifdef _WIN32
1233__declspec(dllimport)
1234#endif
1236 const char *dict_path);
1237
1254#ifdef _WIN32
1255__declspec(dllimport)
1256#endif
1258 const struct VoicevoxUserDictWord *word,
1259 uint8_t (*output_word_uuid)[16]);
1260
1274#ifdef _WIN32
1275__declspec(dllimport)
1276#endif
1278 const uint8_t (*word_uuid)[16],
1279 const struct VoicevoxUserDictWord *word);
1280
1292#ifdef _WIN32
1293__declspec(dllimport)
1294#endif
1296 const uint8_t (*word_uuid)[16]);
1297
1311#ifdef _WIN32
1312__declspec(dllimport)
1313#endif
1315 char **output_json);
1316
1324#ifdef _WIN32
1325__declspec(dllimport)
1326#endif
1328 const struct VoicevoxUserDict *other_dict);
1329
1340#ifdef _WIN32
1341__declspec(dllimport)
1342#endif
1344 const char *path);
1345
1355#ifdef _WIN32
1356__declspec(dllimport)
1357#endif
1359
1360#ifdef __cplusplus
1361} // extern "C"
1362#endif // __cplusplus
1363
1364#endif /* VOICEVOX_CORE_INCLUDE_GUARD */
Definition voicevox_core.h:326
uint16_t cpu_num_threads
Definition voicevox_core.h:335
VoicevoxAccelerationMode acceleration_mode
Definition voicevox_core.h:330
Definition voicevox_core.h:313
const char * filename
Definition voicevox_core.h:319
Definition voicevox_core.h:353
bool enable_interrogative_upspeak
Definition voicevox_core.h:357
Definition voicevox_core.h:363
bool enable_interrogative_upspeak
Definition voicevox_core.h:367
Definition voicevox_core.h:373
VoicevoxUserDictWordType word_type
Definition voicevox_core.h:389
uint32_t priority
Definition voicevox_core.h:393
const char * surface
Definition voicevox_core.h:377
uintptr_t accent_type
Definition voicevox_core.h:385
const char * pronunciation
Definition voicevox_core.h:381
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:348
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:268
VoicevoxUserDictWordType
Definition voicevox_core.h:225
@ VOICEVOX_USER_DICT_WORD_TYPE_ADJECTIVE
Definition voicevox_core.h:241
@ VOICEVOX_USER_DICT_WORD_TYPE_SUFFIX
Definition voicevox_core.h:245
@ VOICEVOX_USER_DICT_WORD_TYPE_PROPER_NOUN
Definition voicevox_core.h:229
@ VOICEVOX_USER_DICT_WORD_TYPE_VERB
Definition voicevox_core.h:237
@ VOICEVOX_USER_DICT_WORD_TYPE_COMMON_NOUN
Definition voicevox_core.h:233
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_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:341
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_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:303
const struct VoicevoxOnnxruntime * voicevox_onnxruntime_get(void)
struct VoicevoxUserDictWord voicevox_user_dict_word_make(const char *surface, const char *pronunciation)
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:112
@ VOICEVOX_RESULT_RUN_MODEL_ERROR
Definition voicevox_core.h:144
@ VOICEVOX_RESULT_USER_DICT_WORD_NOT_FOUND_ERROR
Definition voicevox_core.h:200
@ VOICEVOX_RESULT_USE_USER_DICT_ERROR
Definition voicevox_core.h:204
@ VOICEVOX_RESULT_GPU_SUPPORT_ERROR
Definition voicevox_core.h:128
@ VOICEVOX_RESULT_INVALID_USER_DICT_WORD_ERROR
Definition voicevox_core.h:208
@ VOICEVOX_RESULT_INVALID_UUID_ERROR
Definition voicevox_core.h:212
@ VOICEVOX_RESULT_INVALID_ACCENT_PHRASE_ERROR
Definition voicevox_core.h:164
@ VOICEVOX_RESULT_MODEL_ALREADY_LOADED_ERROR
Definition voicevox_core.h:180
@ VOICEVOX_RESULT_INIT_INFERENCE_RUNTIME_ERROR
Definition voicevox_core.h:132
@ VOICEVOX_RESULT_NOT_LOADED_OPENJTALK_DICT_ERROR
Definition voicevox_core.h:120
@ VOICEVOX_RESULT_EXTRACT_FULL_CONTEXT_LABEL_ERROR
Definition voicevox_core.h:148
@ VOICEVOX_RESULT_INVALID_AUDIO_QUERY_ERROR
Definition voicevox_core.h:160
@ VOICEVOX_RESULT_SAVE_USER_DICT_ERROR
Definition voicevox_core.h:196
@ VOICEVOX_RESULT_INVALID_MODEL_DATA_ERROR
Definition voicevox_core.h:188
@ VOICEVOX_RESULT_OPEN_ZIP_FILE_ERROR
Definition voicevox_core.h:168
@ VOICEVOX_RESULT_OK
Definition voicevox_core.h:116
@ VOICEVOX_RESULT_PARSE_KANA_ERROR
Definition voicevox_core.h:156
@ VOICEVOX_RESULT_STYLE_NOT_FOUND_ERROR
Definition voicevox_core.h:136
@ VOICEVOX_RESULT_GET_SUPPORTED_DEVICES_ERROR
Definition voicevox_core.h:124
@ VOICEVOX_RESULT_STYLE_ALREADY_LOADED_ERROR
Definition voicevox_core.h:184
@ VOICEVOX_RESULT_LOAD_USER_DICT_ERROR
Definition voicevox_core.h:192
@ VOICEVOX_RESULT_MODEL_NOT_FOUND_ERROR
Definition voicevox_core.h:140
@ VOICEVOX_RESULT_READ_ZIP_ENTRY_ERROR
Definition voicevox_core.h:172
@ VOICEVOX_RESULT_INVALID_MODEL_HEADER_ERROR
Definition voicevox_core.h:176
@ VOICEVOX_RESULT_INVALID_UTF8_INPUT_ERROR
Definition voicevox_core.h:152
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:87
@ VOICEVOX_ACCELERATION_MODE_GPU
Definition voicevox_core.h:99
@ VOICEVOX_ACCELERATION_MODE_AUTO
Definition voicevox_core.h:91
@ VOICEVOX_ACCELERATION_MODE_CPU
Definition voicevox_core.h:95
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:290
bool voicevox_synthesizer_is_gpu_mode(const struct VoicevoxSynthesizer *synthesizer)
char * voicevox_voice_model_file_create_metas_json(const struct VoicevoxVoiceModelFile *model)
struct VoicevoxUserDict VoicevoxUserDict
Definition voicevox_core.h:295
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_voice_model_file_close(struct VoicevoxVoiceModelFile *model)
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:283
const char * voicevox_get_onnxruntime_lib_versioned_filename(void)
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)