VoicevoxCore
Loading...
Searching...
No Matches
voicevox_core.h
Go to the documentation of this file.
1
70#ifndef VOICEVOX_CORE_INCLUDE_GUARD
71#define VOICEVOX_CORE_INCLUDE_GUARD
72
73/* Generated with cbindgen:0.28.0 */
74
75#ifdef __cplusplus
76#include <cstdint>
77#else // __cplusplus
78#include <stdbool.h>
79#include <stdint.h>
80#endif // __cplusplus
81
82//#define VOICEVOX_LINK_ONNXRUNTIME
83//#define VOICEVOX_LOAD_ONNXRUNTIME
84
85#if !(defined(VOICEVOX_LINK_ONNXRUNTIME) || defined(VOICEVOX_LOAD_ONNXRUNTIME))
86#error "either `VOICEVOX_LINK_ONNXRUNTIME` or `VOICEVOX_LOAD_ONNXRUNTIME` must be enabled"
87#endif
88
89#if defined(VOICEVOX_LINK_ONNXRUNTIME) && defined(VOICEVOX_LOAD_ONNXRUNTIME)
90#error "`VOICEVOX_LINK_ONNXRUNTIME` or `VOICEVOX_LOAD_ONNXRUNTIME` cannot be enabled at the same time"
91#endif
92
99#ifdef __cplusplus
100 : int32_t
101#endif // __cplusplus
102 {
115};
116#ifndef __cplusplus
117typedef int32_t VoicevoxAccelerationMode;
118#endif // __cplusplus
119
235#ifndef __cplusplus
236typedef int32_t VoicevoxResultCode;
237#endif // __cplusplus
238
270#ifndef __cplusplus
271typedef int32_t VoicevoxUserDictWordType;
272#endif // __cplusplus
273
294
311
320
327
337
338#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
356#endif
357
374
392typedef const uint8_t (*VoicevoxVoiceModelId)[16];
393
401typedef uint32_t VoicevoxStyleId;
402
414
426
454
455#ifdef __cplusplus
456extern "C" {
457#endif // __cplusplus
458
459#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
471#ifdef _WIN32
472__declspec(dllimport)
473#endif
475#endif
476
477#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
487#ifdef _WIN32
488__declspec(dllimport)
489#endif
491#endif
492
493#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
505#ifdef _WIN32
506__declspec(dllimport)
507#endif
509#endif
510
520#ifdef _WIN32
521__declspec(dllimport)
522#endif
524
525#if defined(VOICEVOX_LOAD_ONNXRUNTIME)
547#ifdef _WIN32
548__declspec(dllimport)
549#endif
551 const struct VoicevoxOnnxruntime **out_onnxruntime);
552#endif
553
554#if defined(VOICEVOX_LINK_ONNXRUNTIME)
574#ifdef _WIN32
575__declspec(dllimport)
576#endif
578#endif
579
604#ifdef _WIN32
605__declspec(dllimport)
606#endif
607VoicevoxResultCode voicevox_open_jtalk_rc_new(const char *open_jtalk_dic_dir,
608 struct OpenJtalkRc **out_open_jtalk);
609
620#ifdef _WIN32
621__declspec(dllimport)
622#endif
624 const struct VoicevoxUserDict *user_dict);
625
637#ifdef _WIN32
638__declspec(dllimport)
639#endif
641 const char *text,
642 char **output_accent_phrases_json);
643
661#ifdef _WIN32
662__declspec(dllimport)
663#endif
665
672#ifdef _WIN32
673__declspec(dllimport)
674#endif
676
683#ifdef _WIN32
684__declspec(dllimport)
685#endif
686const char *voicevox_get_version(void);
687
703#ifdef _WIN32
704__declspec(dllimport)
705#endif
707 char **output_audio_query_json);
708
740#ifdef _WIN32
741__declspec(dllimport)
742#endif
744
771#ifdef _WIN32
772__declspec(dllimport)
773#endif
775
803#ifdef _WIN32
804__declspec(dllimport)
805#endif
807
823#ifdef _WIN32
824__declspec(dllimport)
825#endif
827 struct VoicevoxVoiceModelFile **out_model);
828
841#ifdef _WIN32
842__declspec(dllimport)
843#endif
845 uint8_t (*output_voice_model_id)[16]);
846
858#ifdef _WIN32
859__declspec(dllimport)
860#endif
862
874#ifdef _WIN32
875__declspec(dllimport)
876#endif
878
896#ifdef _WIN32
897__declspec(dllimport)
898#endif
900 const struct OpenJtalkRc *open_jtalk,
901 struct VoicevoxInitializeOptions options,
902 struct VoicevoxSynthesizer **out_synthesizer);
903
915#ifdef _WIN32
916__declspec(dllimport)
917#endif
919
930#ifdef _WIN32
931__declspec(dllimport)
932#endif
934 const struct VoicevoxVoiceModelFile *model);
935
950#ifdef _WIN32
951__declspec(dllimport)
952#endif
954 VoicevoxVoiceModelId model_id);
955
965#ifdef _WIN32
966__declspec(dllimport)
967#endif
969
979#ifdef _WIN32
980__declspec(dllimport)
981#endif
983
998#ifdef _WIN32
999__declspec(dllimport)
1000#endif
1002 VoicevoxVoiceModelId model_id);
1003
1015#ifdef _WIN32
1016__declspec(dllimport)
1017#endif
1019
1046#ifdef _WIN32
1047__declspec(dllimport)
1048#endif
1050 char **output_supported_devices_json);
1051
1080#ifdef _WIN32
1081__declspec(dllimport)
1082#endif
1084 const char *kana,
1085 VoicevoxStyleId style_id,
1086 char **output_audio_query_json);
1087
1121#ifdef _WIN32
1122__declspec(dllimport)
1123#endif
1125 const char *text,
1126 VoicevoxStyleId style_id,
1127 char **output_audio_query_json);
1128
1158#ifdef _WIN32
1159__declspec(dllimport)
1160#endif
1162 const char *kana,
1163 VoicevoxStyleId style_id,
1164 char **output_accent_phrases_json);
1165
1199#ifdef _WIN32
1200__declspec(dllimport)
1201#endif
1203 const char *text,
1204 VoicevoxStyleId style_id,
1205 char **output_accent_phrases_json);
1206
1231#ifdef _WIN32
1232__declspec(dllimport)
1233#endif
1235 const char *accent_phrases_json,
1236 VoicevoxStyleId style_id,
1237 char **output_accent_phrases_json);
1238
1258#ifdef _WIN32
1259__declspec(dllimport)
1260#endif
1262 const char *accent_phrases_json,
1263 VoicevoxStyleId style_id,
1264 char **output_accent_phrases_json);
1265
1285#ifdef _WIN32
1286__declspec(dllimport)
1287#endif
1289 const char *accent_phrases_json,
1290 VoicevoxStyleId style_id,
1291 char **output_accent_phrases_json);
1292
1299#ifdef _WIN32
1300__declspec(dllimport)
1301#endif
1303
1326#ifdef _WIN32
1327__declspec(dllimport)
1328#endif
1330 const char *audio_query_json,
1331 VoicevoxStyleId style_id,
1332 struct VoicevoxSynthesisOptions options,
1333 uintptr_t *output_wav_length,
1334 uint8_t **output_wav);
1335
1342#ifdef _WIN32
1343__declspec(dllimport)
1344#endif
1346
1369#ifdef _WIN32
1370__declspec(dllimport)
1371#endif
1373 const char *kana,
1374 VoicevoxStyleId style_id,
1375 struct VoicevoxTtsOptions options,
1376 uintptr_t *output_wav_length,
1377 uint8_t **output_wav);
1378
1406#ifdef _WIN32
1407__declspec(dllimport)
1408#endif
1410 const char *text,
1411 VoicevoxStyleId style_id,
1412 struct VoicevoxTtsOptions options,
1413 uintptr_t *output_wav_length,
1414 uint8_t **output_wav);
1415
1441#ifdef _WIN32
1442__declspec(dllimport)
1443#endif
1444void voicevox_json_free(char *json);
1445
1461#ifdef _WIN32
1462__declspec(dllimport)
1463#endif
1464void voicevox_wav_free(uint8_t *wav);
1465
1490#ifdef _WIN32
1491__declspec(dllimport)
1492#endif
1494
1505#ifdef _WIN32
1506__declspec(dllimport)
1507#endif
1509 const char *pronunciation,
1510 uintptr_t accent_type);
1511
1519#ifdef _WIN32
1520__declspec(dllimport)
1521#endif
1523
1537#ifdef _WIN32
1538__declspec(dllimport)
1539#endif
1541 const char *dict_path);
1542
1561#ifdef _WIN32
1562__declspec(dllimport)
1563#endif
1565 const struct VoicevoxUserDictWord *word,
1566 uint8_t (*output_word_uuid)[16]);
1567
1583#ifdef _WIN32
1584__declspec(dllimport)
1585#endif
1587 const uint8_t (*word_uuid)[16],
1588 const struct VoicevoxUserDictWord *word);
1589
1603#ifdef _WIN32
1604__declspec(dllimport)
1605#endif
1607 const uint8_t (*word_uuid)[16]);
1608
1624#ifdef _WIN32
1625__declspec(dllimport)
1626#endif
1628 char **output_json);
1629
1639#ifdef _WIN32
1640__declspec(dllimport)
1641#endif
1643 const struct VoicevoxUserDict *other_dict);
1644
1657#ifdef _WIN32
1658__declspec(dllimport)
1659#endif
1661 const char *path);
1662
1674#ifdef _WIN32
1675__declspec(dllimport)
1676#endif
1678
1679#ifdef __cplusplus
1680} // extern "C"
1681#endif // __cplusplus
1682
1683#endif /* VOICEVOX_CORE_INCLUDE_GUARD */
Definition voicevox_core.h:363
uint16_t cpu_num_threads
Definition voicevox_core.h:372
VoicevoxAccelerationMode acceleration_mode
Definition voicevox_core.h:367
Definition voicevox_core.h:348
const char * filename
Definition voicevox_core.h:354
Definition voicevox_core.h:408
bool enable_interrogative_upspeak
Definition voicevox_core.h:412
Definition voicevox_core.h:420
bool enable_interrogative_upspeak
Definition voicevox_core.h:424
Definition voicevox_core.h:432
VoicevoxUserDictWordType word_type
Definition voicevox_core.h:448
uint32_t priority
Definition voicevox_core.h:452
const char * surface
Definition voicevox_core.h:436
uintptr_t accent_type
Definition voicevox_core.h:444
const char * pronunciation
Definition voicevox_core.h:440
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)
struct VoicevoxSynthesisOptions VoicevoxSynthesisOptions
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:401
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:293
VoicevoxUserDictWordType
Definition voicevox_core.h:248
@ VOICEVOX_USER_DICT_WORD_TYPE_ADJECTIVE
Definition voicevox_core.h:264
@ VOICEVOX_USER_DICT_WORD_TYPE_SUFFIX
Definition voicevox_core.h:268
@ VOICEVOX_USER_DICT_WORD_TYPE_PROPER_NOUN
Definition voicevox_core.h:252
@ VOICEVOX_USER_DICT_WORD_TYPE_VERB
Definition voicevox_core.h:260
@ VOICEVOX_USER_DICT_WORD_TYPE_COMMON_NOUN
Definition voicevox_core.h:256
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:392
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_audio_query_validate(const char *audio_query_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)
struct VoicevoxInitializeOptions VoicevoxInitializeOptions
VoicevoxResultCode voicevox_onnxruntime_load_once(struct VoicevoxLoadOnnxruntimeOptions options, const struct VoicevoxOnnxruntime **out_onnxruntime)
struct VoicevoxVoiceModelFile VoicevoxVoiceModelFile
Definition voicevox_core.h:336
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:129
@ VOICEVOX_RESULT_RUN_MODEL_ERROR
Definition voicevox_core.h:161
@ VOICEVOX_RESULT_USER_DICT_WORD_NOT_FOUND_ERROR
Definition voicevox_core.h:217
@ VOICEVOX_RESULT_USE_USER_DICT_ERROR
Definition voicevox_core.h:221
@ VOICEVOX_RESULT_GPU_SUPPORT_ERROR
Definition voicevox_core.h:145
@ VOICEVOX_RESULT_INVALID_USER_DICT_WORD_ERROR
Definition voicevox_core.h:225
@ VOICEVOX_RESULT_INVALID_UUID_ERROR
Definition voicevox_core.h:229
@ VOICEVOX_RESULT_INVALID_ACCENT_PHRASE_ERROR
Definition voicevox_core.h:181
@ VOICEVOX_RESULT_ANALYZE_TEXT_ERROR
Definition voicevox_core.h:165
@ VOICEVOX_RESULT_MODEL_ALREADY_LOADED_ERROR
Definition voicevox_core.h:197
@ VOICEVOX_RESULT_INIT_INFERENCE_RUNTIME_ERROR
Definition voicevox_core.h:149
@ VOICEVOX_RESULT_NOT_LOADED_OPENJTALK_DICT_ERROR
Definition voicevox_core.h:137
@ VOICEVOX_RESULT_INVALID_AUDIO_QUERY_ERROR
Definition voicevox_core.h:177
@ VOICEVOX_RESULT_SAVE_USER_DICT_ERROR
Definition voicevox_core.h:213
@ VOICEVOX_RESULT_INVALID_MODEL_DATA_ERROR
Definition voicevox_core.h:205
@ VOICEVOX_RESULT_OPEN_ZIP_FILE_ERROR
Definition voicevox_core.h:185
@ VOICEVOX_RESULT_OK
Definition voicevox_core.h:133
@ VOICEVOX_RESULT_PARSE_KANA_ERROR
Definition voicevox_core.h:173
@ VOICEVOX_RESULT_STYLE_NOT_FOUND_ERROR
Definition voicevox_core.h:153
@ VOICEVOX_RESULT_GET_SUPPORTED_DEVICES_ERROR
Definition voicevox_core.h:141
@ VOICEVOX_RESULT_STYLE_ALREADY_LOADED_ERROR
Definition voicevox_core.h:201
@ VOICEVOX_RESULT_LOAD_USER_DICT_ERROR
Definition voicevox_core.h:209
@ VOICEVOX_RESULT_MODEL_NOT_FOUND_ERROR
Definition voicevox_core.h:157
@ VOICEVOX_RESULT_READ_ZIP_ENTRY_ERROR
Definition voicevox_core.h:189
@ VOICEVOX_RESULT_INVALID_MODEL_HEADER_ERROR
Definition voicevox_core.h:193
@ VOICEVOX_RESULT_INVALID_UTF8_INPUT_ERROR
Definition voicevox_core.h:169
@ VOICEVOX_RESULT_INVALID_MORA_ERROR
Definition voicevox_core.h:233
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:102
@ VOICEVOX_ACCELERATION_MODE_GPU
Definition voicevox_core.h:114
@ VOICEVOX_ACCELERATION_MODE_AUTO
Definition voicevox_core.h:106
@ VOICEVOX_ACCELERATION_MODE_CPU
Definition voicevox_core.h:110
VoicevoxResultCode voicevox_accent_phrase_validate(const char *accent_phrase_json)
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:319
VoicevoxResultCode voicevox_mora_validate(const char *mora_json)
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 VoicevoxTtsOptions VoicevoxTtsOptions
struct VoicevoxUserDict VoicevoxUserDict
Definition voicevox_core.h:326
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)
struct VoicevoxLoadOnnxruntimeOptions VoicevoxLoadOnnxruntimeOptions
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:310
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)
struct VoicevoxUserDictWord VoicevoxUserDictWord
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)