-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCoreUnsafe.g.cs
More file actions
1480 lines (1391 loc) · 79 KB
/
Copy pathCoreUnsafe.g.cs
File metadata and controls
1480 lines (1391 loc) · 79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// <auto-generated>
// This code is generated by csbindgen.
// DON'T CHANGE THIS DIRECTLY.
// </auto-generated>
#pragma warning disable CS8500
#pragma warning disable CS8981
using System;
using System.Runtime.InteropServices;
namespace VoicevoxCoreSharp.Core.Native
{
internal static unsafe partial class CoreUnsafe
{
#if UNITY_IOS && !UNITY_EDITOR
const string __DllName = "__Internal";
#else
const string __DllName = "voicevox_core";
#endif
/// <summary>
/// ONNX Runtimeの動的ライブラリの、バージョン付きのファイル名。
///
/// WindowsとAndroidでは ::voicevox_get_onnxruntime_lib_unversioned_filename と同じ。
///
/// \availability{
/// [リリース](https://github.com/voicevox/voicevox_core/releases)されているライブラリではiOSを除くプラットフォームで利用可能。詳細は<a href="#voicevox-core-availability">ファイルレベルの"Availability"の節</a>を参照。
/// }
///
/// \orig-impl{voicevox_get_onnxruntime_lib_versioned_filename}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_get_onnxruntime_lib_versioned_filename", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern byte* voicevox_get_onnxruntime_lib_versioned_filename();
/// <summary>
/// ONNX Runtimeの動的ライブラリの、バージョン無しのファイル名。
///
/// \availability{
/// [リリース](https://github.com/voicevox/voicevox_core/releases)されているライブラリではiOSを除くプラットフォームで利用可能。詳細は<a href="#voicevox-core-availability">ファイルレベルの"Availability"の節</a>を参照。
/// }
///
/// \orig-impl{voicevox_get_onnxruntime_lib_unversioned_filename}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_get_onnxruntime_lib_unversioned_filename", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern byte* voicevox_get_onnxruntime_lib_unversioned_filename();
/// <summary>
/// デフォルトの ::voicevox_onnxruntime_load_once のオプションを生成する。
///
/// @return デフォルトの ::voicevox_onnxruntime_load_once のオプション
///
/// \availability{
/// [リリース](https://github.com/voicevox/voicevox_core/releases)されているライブラリではiOSを除くプラットフォームで利用可能。詳細は<a href="#voicevox-core-availability">ファイルレベルの"Availability"の節</a>を参照。
/// }
///
/// \no-orig-impl{voicevox_make_default_load_onnxruntime_options}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_make_default_load_onnxruntime_options", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxLoadOnnxruntimeOptions voicevox_make_default_load_onnxruntime_options();
/// <summary>
/// ::VoicevoxOnnxruntime のインスタンスが既に作られているならそれを得る。
///
/// 作られていなければ`NULL`を返す。
///
/// @returns ::VoicevoxOnnxruntime のインスタンス
///
/// \orig-impl{voicevox_onnxruntime_get}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_onnxruntime_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxOnnxruntime* voicevox_onnxruntime_get();
/// <summary>
/// ONNX Runtimeをロードして初期化する。
///
/// 一度成功したら、以後は引数を無視して同じ参照を返す。
///
/// @param [in] options オプション
/// @param [out] out_onnxruntime ::VoicevoxOnnxruntime のインスタンス
///
/// @returns 結果コード
///
/// \availability{
/// [リリース](https://github.com/voicevox/voicevox_core/releases)されているライブラリではiOSを除くプラットフォームで利用可能。詳細は<a href="#voicevox-core-availability">ファイルレベルの"Availability"の節</a>を参照。
/// }
///
/// \safety{
/// - `options.filename`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// - `out_onnxruntime`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_onnxruntime_load_once}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_onnxruntime_load_once", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_onnxruntime_load_once(VoicevoxLoadOnnxruntimeOptions options, VoicevoxOnnxruntime** out_onnxruntime);
/// <summary>
/// ONNX Runtimeを初期化する。
///
/// 一度成功したら以後は同じ参照を返す。
///
/// @param [out] out_onnxruntime ::VoicevoxOnnxruntime のインスタンス
///
/// @returns 結果コード
///
/// \availability{
/// [リリース](https://github.com/voicevox/voicevox_core/releases)されているライブラリではiOSでのみ利用可能。詳細は<a href="#voicevox-core-availability">ファイルレベルの"Availability"の節</a>を参照。
/// }
///
/// \safety{
/// - `out_onnxruntime`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_onnxruntime_init_once}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_onnxruntime_init_once", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_onnxruntime_init_once(VoicevoxOnnxruntime** out_onnxruntime);
/// <summary>
/// ::OpenJtalkRc を<b>構築</b>(_construct_)する。
///
/// 解放は ::voicevox_open_jtalk_rc_delete で行う。
///
/// @param [in] open_jtalk_dic_dir 辞書ディレクトリを指すUTF-8のパス
/// @param [out] out_open_jtalk 構築先
///
/// @returns 結果コード
///
/// \example{
/// ```c
/// OpenJtalkRc *open_jtalk;
/// voicevox_open_jtalk_rc_new("./open_jtalk_dic_utf_8-1.11", &open_jtalk);
/// ```
/// }
///
/// \safety{
/// - `open_jtalk_dic_dir`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// - `out_open_jtalk`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_open_jtalk_rc_new}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_open_jtalk_rc_new", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_open_jtalk_rc_new(byte* open_jtalk_dic_dir, OpenJtalkRc** out_open_jtalk);
/// <summary>
/// OpenJtalkの使うユーザー辞書を設定する。
///
/// この関数を呼び出した後にユーザー辞書を変更した場合、再度この関数を呼び出す必要がある。
///
/// @param [in] open_jtalk Open JTalkのオブジェクト
/// @param [in] user_dict ユーザー辞書
///
/// \orig-impl{voicevox_open_jtalk_rc_use_user_dict}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_open_jtalk_rc_use_user_dict", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_open_jtalk_rc_use_user_dict(OpenJtalkRc* open_jtalk, VoicevoxUserDict* user_dict);
/// <summary>
/// 日本語のテキストを解析する。
///
/// 生成したJSON文字列を解放するには ::voicevox_json_free を使う。
///
/// @param [in] open_jtalk Open JTalkのオブジェクト
/// @param [in] text UTF-8の日本語テキスト
/// @param [out] output_accent_phrases_json 生成先
///
/// \orig-impl{voicevox_open_jtalk_rc_use_user_dict}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_open_jtalk_rc_analyze", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_open_jtalk_rc_analyze(OpenJtalkRc* open_jtalk, byte* text, byte** output_accent_phrases_json);
/// <summary>
/// ::OpenJtalkRc を<b>破棄</b>(_destruct_)する。
///
/// 破棄対象への他スレッドでのアクセスが存在する場合、それらがすべて終わるのを待ってから破棄する。
///
/// この関数の呼び出し後に破棄し終えた対象にアクセスすると、プロセスを異常終了する。
///
/// @param [in] open_jtalk 破棄対象。nullable
///
/// \example{
/// ```c
/// voicevox_open_jtalk_rc_delete(open_jtalk);
/// ```
/// }
///
/// \no-orig-impl{voicevox_open_jtalk_rc_delete}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_open_jtalk_rc_delete", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern void voicevox_open_jtalk_rc_delete(OpenJtalkRc* open_jtalk);
/// <summary>
/// デフォルトの初期化オプションを生成する
/// @return デフォルト値が設定された初期化オプション
///
/// \no-orig-impl{voicevox_make_default_initialize_options}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_make_default_initialize_options", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxInitializeOptions voicevox_make_default_initialize_options();
/// <summary>
/// voicevoxのバージョンを取得する。
/// @return SemVerでフォーマットされたバージョン。
///
/// \orig-impl{voicevox_get_version}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_get_version", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern byte* voicevox_get_version();
/// <summary>
/// AccentPhraseの配列からAudioQueryを作る。
///
/// 生成したJSON文字列を解放するには ::voicevox_json_free を使う。
///
/// @param [in] accent_phrases_json AccentPhraseの配列のJSON文字列
/// @param [out] output_accent_phrases_json 生成先
///
/// \safety{
/// - `accent_phrases_json`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// - `output_audio_query_json`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_audio_query_create_from_accent_phrases}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_audio_query_create_from_accent_phrases", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_audio_query_create_from_accent_phrases(byte* accent_phrases_json, byte** output_audio_query_json);
/// <summary>
/// 与えられたJSONが`AudioQuery`型として不正であるときエラーを返す。
///
/// 不正であるとは、以下のいずれかの条件を満たすことである。
///
/// - [Rust APIの`AudioQuery`型]としてデシリアライズ不可、もしくはJSONとして不正。
/// - `accent_phrases`の要素のうちいずれかが、 ::voicevox_accent_phrase_validate でエラーになる。
/// - `outputSamplingRate`が`24000`の倍数ではない、もしくは`0` (将来的に解消予定。cf. [#762])。
///
/// [Rust APIの`AudioQuery`型]: ../rust_api/voicevox_core/struct.AudioQuery.html
/// [#762]: https://github.com/VOICEVOX/voicevox_core/issues/762
///
/// 次の状態に対しては警告のログを出す。将来的にはエラーになる予定。
///
/// - `accent_phrases`の要素のうちいずれかが警告が出る状態。
/// - `speedScale`が負。
/// - `volumeScale`が負。
/// - `prePhonemeLength`が負。
/// - `postPhonemeLength`が負。
/// - `outputSamplingRate`が`24000`以外の値(エラーと同様将来的に解消予定)。
///
/// @param [in] audio_query_json `AudioQuery`型のJSON
///
/// @returns 成功時には ::VOICEVOX_RESULT_OK 、失敗時には ::VOICEVOX_RESULT_INVALID_AUDIO_QUERY_ERROR
///
/// \safety{
/// - `audio_query_json`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_audio_query_validate}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_audio_query_validate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_audio_query_validate(byte* audio_query_json);
/// <summary>
/// 与えられたJSONが`AccentPhrase`型として不正であるときエラーを返す。
///
/// 不正であるとは、以下のいずれかの条件を満たすことである。
///
/// - [Rust APIの`AccentPhrase`型]としてデシリアライズ不可、もしくはJSONとして不正。
/// - `moras`もしくは`pause_mora`の要素のうちいずれかが、 ::voicevox_mora_validate でエラーになる。
/// - `accent`が`0`。
///
/// [Rust APIの`AccentPhrase`型]: ../rust_api/voicevox_core/struct.AccentPhrase.html
///
/// 次の状態に対しては警告のログを出す。将来的にはエラーになる予定。
///
/// - `moras`もしくは`pause_mora`の要素のうちいずれかが、警告が出る状態。
/// - `accent`が`moras`の数を超過している。
///
/// @param [in] accent_phrase_json `AccentPhrase`型のJSON
///
/// @returns 成功時には ::VOICEVOX_RESULT_OK 、失敗時には ::VOICEVOX_RESULT_INVALID_ACCENT_PHRASE_ERROR
///
/// \safety{
/// - `accent_phrase_json`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_accent_phrase_validate}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_accent_phrase_validate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_accent_phrase_validate(byte* accent_phrase_json);
/// <summary>
/// 与えられたJSONが`Mora`型として不正であるときエラーを返す。
///
/// 不正であるとは、以下のいずれかの条件を満たすことである。
///
/// - [Rust APIの`Mora`型]としてデシリアライズ不可、もしくはJSONとして不正。
/// - `consonant`と`consonant_length`の有無が不一致。
/// - `consonant`が子音以外の音素であるか、もしくは音素として不正。
/// - `vowel`が子音であるか、もしくは音素として不正。
///
/// [Rust APIの`Mora`型]: ../rust_api/voicevox_core/struct.Mora.html
///
/// 次の状態に対しては警告のログを出す。将来的にはエラーになる予定。
///
/// - `consonant_length`が負。
/// - `vowel_length`が負。
///
/// @param [in] mora_json `Mora`型のJSON
///
/// @returns 成功時には ::VOICEVOX_RESULT_OK 、失敗時には ::VOICEVOX_RESULT_INVALID_MORA_ERROR
///
/// \safety{
/// - `mora_json`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_mora_validate}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_mora_validate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_mora_validate(byte* mora_json);
/// <summary>
/// 与えられたJSONが`Score`型として不正であるときエラーを返す。
///
/// 不正であるとは、以下のいずれかの条件を満たすことである。
///
/// - [Rust APIの`Score`型]としてデシリアライズ不可、もしくはJSONとして不正。
/// - `notes`の要素のうちいずれかが、 ::voicevox_note_validate でエラーになる。
/// - `notes`が空であるか、もしくは先頭が音符。
///
/// [Rust APIの`Score`型]: ../rust_api/voicevox_core/struct.Score.html
///
/// @param [in] score_json `Score`型のJSON
///
/// @returns 成功時には ::VOICEVOX_RESULT_OK 、失敗時には ::VOICEVOX_RESULT_INVALID_SCORE_ERROR
///
/// \safety{
/// - `score_json`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_score_validate}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_score_validate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_score_validate(byte* score_json);
/// <summary>
/// 与えられたJSONが`Note`型として不正であるときエラーを返す。
///
/// 不正であるとは、以下のいずれかの条件を満たすことである。
///
/// - [Rust APIの`Note`型]としてデシリアライズ不可、もしくはJSONとして不正。
/// - `key`が`null`かつ`lyric`が`""`以外。
/// - `key`が非`null`かつ`lyric`が`""`。
///
/// [Rust APIの`Note`型]: ../rust_api/voicevox_core/struct.Note.html
///
/// @param [in] note_json `Note`型のJSON
///
/// @returns 成功時には ::VOICEVOX_RESULT_OK 、失敗時には ::VOICEVOX_RESULT_INVALID_NOTE_ERROR
///
/// \safety{
/// - `note_json`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_note_validate}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_note_validate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_note_validate(byte* note_json);
/// <summary>
/// 与えられたJSONが`FrameAudioQuery`型として不正であるときエラーを返す。
///
/// 不正であるとは、以下の条件を満たすことである。
///
/// - [Rust APIの`FrameAudioQuery`型]としてデシリアライズ不可、もしくはJSONとして不正。
///
/// [Rust APIの`FrameAudioQuery`型]: ../rust_api/voicevox_core/struct.FrameAudioQuery.html
///
/// 次の状態に対しては警告のログを出す。将来的にはエラーになる予定。
///
/// - `outputSamplingRate`が`24000`以外の値(将来的に解消予定)。
///
/// @param [in] frame_audio_query_json `FrameAudioQuery`型のJSON
///
/// @returns 成功時には ::VOICEVOX_RESULT_OK 、失敗時には ::VOICEVOX_RESULT_INVALID_FRAME_AUDIO_QUERY_ERROR
///
/// \safety{
/// - `frame_audio_query_json`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_frame_audio_query_validate}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_frame_audio_query_validate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_frame_audio_query_validate(byte* frame_audio_query_json);
/// <summary>
/// 与えられたJSONが`FramePhoneme`型として不正であるときエラーを返す。
///
/// 不正であるとは、以下の条件を満たすことである。
///
/// - [Rust APIの`FramePhoneme`型]としてデシリアライズ不可、もしくはJSONとして不正。
///
/// [Rust APIの`FramePhoneme`型]: ../rust_api/voicevox_core/struct.FramePhoneme.html
///
/// @param [in] frame_phoneme_json `FramePhoneme`型のJSON
///
/// @returns 成功時には ::VOICEVOX_RESULT_OK 、失敗時には ::VOICEVOX_RESULT_INVALID_FRAME_PHONEME_ERROR
///
/// \safety{
/// - `frame_phoneme_json`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// }
///
/// \no-orig-impl{voicevox_frame_phoneme_validate}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_frame_phoneme_validate", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_frame_phoneme_validate(byte* frame_phoneme_json);
/// <summary>
/// 与えられた楽譜と歌唱合成用のクエリの組み合わせが、基本周波数と音量の生成に利用できるかどうかを確認する。
///
/// 次のうちどれかを満たすならエラーを返す。
///
/// - `score_json`が ::voicevox_score_validate でエラーになる。
/// - `frame_audio_query_json`が ::voicevox_frame_audio_query_validate でエラーになる。
/// - `notes`が表す音素ID列と、`phonemes`が表す音素ID列が等しくない。ただし異なる音素の表現が同一のIDを表すことがある。
///
/// @param [in] score_json `Score`型のJSON
/// @param [in] frame_audio_query_json `FrameAudioQuery`型のJSON
///
/// @returns 成功時には ::VOICEVOX_RESULT_OK 、失敗時には ::VOICEVOX_RESULT_INVALID_SCORE_ERROR, ::VOICEVOX_RESULT_INVALID_FRAME_AUDIO_QUERY_ERROR, ::VOICEVOX_RESULT_INCOMPATIBLE_QUERIES_ERROR
///
/// \safety{
/// - `score_json`と`frame_audio_query_json`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// }
/// \orig-impl{voicevox_ensure_compatible}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_ensure_compatible", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_ensure_compatible(byte* score_json, byte* frame_audio_query_json);
/// <summary>
/// VVMファイルを開く。
///
/// @param [in] path vvmファイルへのUTF-8のファイルパス
/// @param [out] out_model 構築先
///
/// @returns 結果コード
///
/// \safety{
/// - `path`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// - `out_model`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_voice_model_file_open}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_voice_model_file_open", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_voice_model_file_open(byte* path, VoicevoxVoiceModelFile** out_model);
/// <summary>
/// ::VoicevoxVoiceModelFile からIDを取得する。
///
/// @param [in] model 音声モデル
/// @param [out] output_voice_model_id 音声モデルID。詳細は ::VoicevoxVoiceModelId
///
/// \safety{
/// - `output_voice_model_id`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_voice_model_file_id}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_voice_model_file_id", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern void voicevox_voice_model_file_id(VoicevoxVoiceModelFile* model, void/* byte[] */* output_voice_model_id);
/// <summary>
/// ::VoicevoxVoiceModelFile からメタ情報を取得する。
///
/// JSONの解放は ::voicevox_json_free で行う。
///
/// @param [in] model 音声モデル
///
/// @returns メタ情報のJSON文字列
///
/// \orig-impl{voicevox_voice_model_file_create_metas_json}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_voice_model_file_create_metas_json", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern byte* voicevox_voice_model_file_create_metas_json(VoicevoxVoiceModelFile* model);
/// <summary>
/// ::VoicevoxVoiceModelFile を、所有しているファイルディスクリプタを閉じた上で<b>破棄</b>(_destruct_)する。ファイルの削除(_delete_)<b>ではない</b>。
///
/// 破棄対象への他スレッドでのアクセスが存在する場合、それらがすべて終わるのを待ってから破棄する。
///
/// この関数の呼び出し後に破棄し終えた対象にアクセスすると、プロセスを異常終了する。
///
/// @param [in] model 破棄対象。nullable
///
/// \no-orig-impl{voicevox_voice_model_file_delete}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_voice_model_file_delete", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern void voicevox_voice_model_file_delete(VoicevoxVoiceModelFile* model);
/// <summary>
/// ::VoicevoxSynthesizer を<b>構築</b>(_construct_)する。
///
/// @param [in] onnxruntime
/// @param [in] open_jtalk Open JTalkのオブジェクト
/// @param [in] options オプション
/// @param [out] out_synthesizer 構築先
///
/// @returns 結果コード
///
/// \safety{
/// - `onnxruntime`は ::voicevox_onnxruntime_load_once または ::voicevox_onnxruntime_init_once で得たものでなければならない。
/// - `out_synthesizer`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_synthesizer_new}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_new", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_synthesizer_new(VoicevoxOnnxruntime* onnxruntime, OpenJtalkRc* open_jtalk, VoicevoxInitializeOptions options, VoicevoxSynthesizer** out_synthesizer);
/// <summary>
/// ::VoicevoxSynthesizer を<b>破棄</b>(_destruct_)する。
///
/// 破棄対象への他スレッドでのアクセスが存在する場合、それらがすべて終わるのを待ってから破棄する。
///
/// この関数の呼び出し後に破棄し終えた対象にアクセスすると、プロセスを異常終了する。
///
/// @param [in] synthesizer 破棄対象。nullable
///
/// \no-orig-impl{voicevox_synthesizer_delete}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_delete", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern void voicevox_synthesizer_delete(VoicevoxSynthesizer* synthesizer);
/// <summary>
/// デフォルトの `voicevox_synthesizer_load_voice_model` のオプションを生成する
/// @return デフォルト値が設定された `voicevox_synthesizer_load_voice_model` のオプション
///
/// \no-orig-impl{voicevox_make_default_load_voice_model_options}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_make_default_load_voice_model_options", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxLoadVoiceModelOptions voicevox_make_default_load_voice_model_options();
/// <summary>
/// 音声モデルを読み込む。
///
/// @param [in] synthesizer 音声シンセサイザ
/// @param [in] model 音声モデル
/// @param [in] options オプション
///
/// @returns 結果コード
///
/// \orig-impl{voicevox_synthesizer_load_voice_model}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_load_voice_model", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_synthesizer_load_voice_model(VoicevoxSynthesizer* synthesizer, VoicevoxVoiceModelFile* model, VoicevoxLoadVoiceModelOptions options);
/// <summary>
/// 音声モデルの読み込みを解除する。
///
/// @param [in] synthesizer 音声シンセサイザ
/// @param [in] model_id 音声モデルID
///
/// @returns 結果コード
///
/// \safety{
/// - `model_id`は<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_synthesizer_unload_voice_model}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_unload_voice_model", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_synthesizer_unload_voice_model(VoicevoxSynthesizer* synthesizer, void/* byte[] */* model_id);
/// <summary>
/// ::VoicevoxOnnxruntime のインスタンスを得る。
///
/// @param [in] synthesizer 音声シンセサイザ
///
/// @returns ::VoicevoxOnnxruntime のインスタンス
///
/// \orig-impl{voicevox_synthesizer_get_onnxruntime}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_get_onnxruntime", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxOnnxruntime* voicevox_synthesizer_get_onnxruntime(VoicevoxSynthesizer* synthesizer);
/// <summary>
/// ハードウェアアクセラレーションがGPUモードか判定する。
///
/// @param [in] synthesizer 音声シンセサイザ
///
/// @returns GPUモードかどうか
///
/// \orig-impl{voicevox_synthesizer_is_gpu_mode}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_is_gpu_mode", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.U1)]
internal static extern bool voicevox_synthesizer_is_gpu_mode(VoicevoxSynthesizer* synthesizer);
/// <summary>
/// 指定したIDの音声モデルが読み込まれているか判定する。
///
/// @param [in] synthesizer 音声シンセサイザ
/// @param [in] model_id 音声モデルID
///
/// @returns モデルが読み込まれているかどうか
///
/// \safety{
/// - `model_id`は<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_synthesizer_is_loaded_voice_model}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_is_loaded_voice_model", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.U1)]
internal static extern bool voicevox_synthesizer_is_loaded_voice_model(VoicevoxSynthesizer* synthesizer, void/* byte[] */* model_id);
/// <summary>
/// 今読み込んでいる音声モデルのメタ情報を、JSONで取得する。
///
/// JSONの解放は ::voicevox_json_free で行う。
///
/// @param [in] synthesizer 音声シンセサイザ
///
/// @return メタ情報のJSON文字列
///
/// \orig-impl{voicevox_synthesizer_create_metas_json}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_create_metas_json", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern byte* voicevox_synthesizer_create_metas_json(VoicevoxSynthesizer* synthesizer);
/// <summary>
/// ONNX Runtimeとして利用可能なデバイスの情報を、JSONで取得する。
///
/// JSONの解放は ::voicevox_json_free で行う。
///
/// あくまでONNX Runtimeが対応しているデバイスの情報であることに注意。GPUが使える環境ではなかったとしても`cuda`や`dml`は`true`を示しうる。
///
/// @param [in] onnxruntime
/// @param [out] output_supported_devices_json サポートデバイス情報のJSON文字列
///
/// @returns 結果コード
///
/// \example{
/// ```c
/// char *supported_devices;
/// VoicevoxResultCode result = voicevox_onnxruntime_create_supported_devices_json(onnxruntime, &supported_devices);
/// ```
/// }
///
/// \safety{
/// - `onnxruntime`は ::voicevox_onnxruntime_load_once または ::voicevox_onnxruntime_init_once で得たものでなければならない。
/// - `output_supported_devices_json`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_onnxruntime_create_supported_devices_json}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_onnxruntime_create_supported_devices_json", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_onnxruntime_create_supported_devices_json(VoicevoxOnnxruntime* onnxruntime, byte** output_supported_devices_json);
/// <summary>
/// AquesTalk風記法から、AudioQueryをJSONとして生成する。
///
/// 生成したJSON文字列を解放するには ::voicevox_json_free を使う。
///
/// @param [in] synthesizer 音声シンセサイザ
/// @param [in] kana AquesTalk風記法
/// @param [in] style_id スタイルID
/// @param [out] output_audio_query_json 生成先
///
/// @returns 結果コード
///
/// \example{
/// ```c
/// char *audio_query;
/// voicevox_synthesizer_create_audio_query_from_kana(synthesizer, "コンニチワ'",
/// 2, // "四国めたん (ノーマル)"
/// &audio_query);
/// ```
/// }
///
/// \safety{
/// - `kana`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// - `output_audio_query_json`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_synthesizer_create_audio_query_from_kana}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_create_audio_query_from_kana", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_synthesizer_create_audio_query_from_kana(VoicevoxSynthesizer* synthesizer, byte* kana, uint style_id, byte** output_audio_query_json);
/// <summary>
/// 日本語テキストから、AudioQueryをJSONとして生成する。
///
/// 生成したJSON文字列を解放するには ::voicevox_json_free を使う。
///
/// ::voicevox_synthesizer_create_accent_phrases と ::voicevox_audio_query_create_from_accent_phrases
/// が一体になったショートハンド。詳細は[テキスト音声合成の流れ]を参照。
///
/// @param [in] synthesizer 音声シンセサイザ
/// @param [in] text UTF-8の日本語テキスト
/// @param [in] style_id スタイルID
/// @param [out] output_audio_query_json 生成先
///
/// @returns 結果コード
///
/// \example{
/// ```c
/// char *audio_query;
/// voicevox_synthesizer_create_audio_query(synthesizer, "こんにちは",
/// 2, // "四国めたん (ノーマル)"
/// &audio_query);
/// ```
/// }
///
/// \safety{
/// - `text`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// - `output_audio_query_json`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_synthesizer_create_audio_query}
///
/// [テキスト音声合成の流れ]: https://github.com/VOICEVOX/voicevox_core/blob/main/docs/guide/user/tts-process.md
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_create_audio_query", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_synthesizer_create_audio_query(VoicevoxSynthesizer* synthesizer, byte* text, uint style_id, byte** output_audio_query_json);
/// <summary>
/// AquesTalk風記法から、AccentPhrase (アクセント句)の配列をJSON形式で生成する。
///
/// 生成したJSON文字列を解放するには ::voicevox_json_free を使う。
///
/// @param [in] synthesizer 音声シンセサイザ
/// @param [in] kana AquesTalk風記法
/// @param [in] style_id スタイルID
/// @param [out] output_accent_phrases_json 生成先
///
/// @returns 結果コード
///
/// \example{
/// ```c
/// char *accent_phrases;
/// voicevox_synthesizer_create_accent_phrases_from_kana(
/// synthesizer, "コンニチワ'",
/// 2, // "四国めたん (ノーマル)"
/// &accent_phrases);
/// ```
/// }
///
/// \safety{
/// - `kana`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// - `output_audio_query_json`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_synthesizer_create_accent_phrases_from_kana}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_create_accent_phrases_from_kana", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_synthesizer_create_accent_phrases_from_kana(VoicevoxSynthesizer* synthesizer, byte* kana, uint style_id, byte** output_accent_phrases_json);
/// <summary>
/// 日本語テキストから、AccentPhrase (アクセント句)の配列をJSON形式で生成する。
///
/// 生成したJSON文字列を解放するには ::voicevox_json_free を使う。
///
/// ::voicevox_open_jtalk_rc_analyze と ::voicevox_synthesizer_replace_mora_data
/// が一体になったショートハンド。詳細は[テキスト音声合成の流れ]を参照。
///
/// @param [in] synthesizer 音声シンセサイザ
/// @param [in] text UTF-8の日本語テキスト
/// @param [in] style_id スタイルID
/// @param [out] output_accent_phrases_json 生成先
///
/// @returns 結果コード
///
/// \example{
/// ```c
/// char *accent_phrases;
/// voicevox_synthesizer_create_accent_phrases(synthesizer, "こんにちは",
/// 2, // "四国めたん (ノーマル)"
/// &accent_phrases);
/// ```
/// }
///
/// \safety{
/// - `text`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// - `output_audio_query_json`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_synthesizer_create_accent_phrases}
///
/// [テキスト音声合成の流れ]: https://github.com/VOICEVOX/voicevox_core/blob/main/docs/guide/user/tts-process.md
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_create_accent_phrases", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_synthesizer_create_accent_phrases(VoicevoxSynthesizer* synthesizer, byte* text, uint style_id, byte** output_accent_phrases_json);
/// <summary>
/// AccentPhraseの配列の音高・音素長を、特定の声で生成しなおす。
///
/// 生成したJSON文字列を解放するには ::voicevox_json_free を使う。
///
/// ::voicevox_synthesizer_replace_phoneme_length と ::voicevox_synthesizer_replace_mora_pitch
/// が一体になったショートハンド。詳細は[テキスト音声合成の流れ]を参照。
///
/// @param [in] synthesizer 音声シンセサイザ
/// @param [in] accent_phrases_json AccentPhraseの配列のJSON文字列
/// @param [in] style_id スタイルID
/// @param [out] output_accent_phrases_json 生成先
///
/// @returns 結果コード
///
/// \safety{
/// - `accent_phrases_json`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// - `output_audio_query_json`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_synthesizer_replace_mora_data}
///
/// [テキスト音声合成の流れ]: https://github.com/VOICEVOX/voicevox_core/blob/main/docs/guide/user/tts-process.md
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_replace_mora_data", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_synthesizer_replace_mora_data(VoicevoxSynthesizer* synthesizer, byte* accent_phrases_json, uint style_id, byte** output_accent_phrases_json);
/// <summary>
/// AccentPhraseの配列の音素長を、特定の声で生成しなおす。
///
/// 生成したJSON文字列を解放するには ::voicevox_json_free を使う。
///
/// @param [in] synthesizer 音声シンセサイザ
/// @param [in] accent_phrases_json AccentPhraseの配列のJSON文字列
/// @param [in] style_id スタイルID
/// @param [out] output_accent_phrases_json 生成先
///
/// @returns 結果コード
///
/// \safety{
/// - `accent_phrases_json`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// - `output_audio_query_json`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_synthesizer_replace_phoneme_length}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_replace_phoneme_length", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_synthesizer_replace_phoneme_length(VoicevoxSynthesizer* synthesizer, byte* accent_phrases_json, uint style_id, byte** output_accent_phrases_json);
/// <summary>
/// AccentPhraseの配列の音高を、特定の声で生成しなおす。
///
/// 生成したJSON文字列を解放するには ::voicevox_json_free を使う。
///
/// @param [in] synthesizer 音声シンセサイザ
/// @param [in] accent_phrases_json AccentPhraseの配列のJSON文字列
/// @param [in] style_id スタイルID
/// @param [out] output_accent_phrases_json 生成先
///
/// @returns 結果コード
///
/// \safety{
/// - `accent_phrases_json`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// - `output_audio_query_json`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_synthesizer_replace_mora_pitch}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_replace_mora_pitch", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_synthesizer_replace_mora_pitch(VoicevoxSynthesizer* synthesizer, byte* accent_phrases_json, uint style_id, byte** output_accent_phrases_json);
/// <summary>
/// デフォルトの `voicevox_synthesizer_synthesis` のオプションを生成する
/// @return デフォルト値が設定された `voicevox_synthesizer_synthesis` のオプション
///
/// \no-orig-impl{voicevox_make_default_synthesis_options}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_make_default_synthesis_options", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxSynthesisOptions voicevox_make_default_synthesis_options();
/// <summary>
/// AudioQueryから音声合成を行う。
///
/// 生成したWAVデータを解放するには ::voicevox_wav_free を使う。
///
/// @param [in] synthesizer 音声シンセサイザ
/// @param [in] audio_query_json AudioQueryのJSON文字列
/// @param [in] style_id スタイルID
/// @param [in] options オプション
/// @param [out] output_wav_length 出力のバイト長
/// @param [out] output_wav 出力先
///
/// @returns 結果コード
///
/// \safety{
/// - `audio_query_json`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// - `output_wav_length`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// - `output_wav`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_synthesizer_synthesis}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_synthesis", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_synthesizer_synthesis(VoicevoxSynthesizer* synthesizer, byte* audio_query_json, uint style_id, VoicevoxSynthesisOptions options, nuint* output_wav_length, byte** output_wav);
/// <summary>
/// デフォルトのテキスト音声合成オプションを生成する
/// @return テキスト音声合成オプション
///
/// \no-orig-impl{voicevox_make_default_tts_options}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_make_default_tts_options", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxTtsOptions voicevox_make_default_tts_options();
/// <summary>
/// AquesTalk風記法から音声合成を行う。
///
/// 生成したWAVデータを解放するには ::voicevox_wav_free を使う。
///
/// @param [in] synthesizer
/// @param [in] kana AquesTalk風記法
/// @param [in] style_id スタイルID
/// @param [in] options オプション
/// @param [out] output_wav_length 出力のバイト長
/// @param [out] output_wav 出力先
///
/// @returns 結果コード
///
/// \safety{
/// - `kana`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// - `output_wav_length`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// - `output_wav`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_synthesizer_tts_from_kana}
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_tts_from_kana", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_synthesizer_tts_from_kana(VoicevoxSynthesizer* synthesizer, byte* kana, uint style_id, VoicevoxTtsOptions options, nuint* output_wav_length, byte** output_wav);
/// <summary>
/// 日本語テキストから音声合成を行う。
///
/// 生成したWAVデータを解放するには ::voicevox_wav_free を使う。
///
/// ::voicevox_synthesizer_create_audio_query と ::voicevox_synthesizer_synthesis
/// が一体になったショートハンド。詳細は[テキスト音声合成の流れ]を参照。
///
/// @param [in] synthesizer
/// @param [in] text UTF-8の日本語テキスト
/// @param [in] style_id スタイルID
/// @param [in] options オプション
/// @param [out] output_wav_length 出力のバイト長
/// @param [out] output_wav 出力先
///
/// @returns 結果コード
///
/// \safety{
/// - `text`はヌル終端文字列を指し、かつ<a href="#voicevox-core-safety">読み込みについて有効</a>でなければならない。
/// - `output_wav_length`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// - `output_wav`は<a href="#voicevox-core-safety">書き込みについて有効</a>でなければならない。
/// }
///
/// \orig-impl{voicevox_synthesizer_tts}
///
/// [テキスト音声合成の流れ]: https://github.com/VOICEVOX/voicevox_core/blob/main/docs/guide/user/tts-process.md
/// </summary>
[DllImport(__DllName, EntryPoint = "voicevox_synthesizer_tts", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
internal static extern VoicevoxResultCode voicevox_synthesizer_tts(VoicevoxSynthesizer* synthesizer, byte* text, uint style_id, VoicevoxTtsOptions options, nuint* output_wav_length, byte** output_wav);
/// <summary>
/// 楽譜から歌唱音声合成用のクエリを作成する。
///
/// 詳細はユーザーガイド[歌唱音声合成]を参照。
///
/// [歌唱音声合成]: https://github.com/VOICEVOX/voicevox_core/blob/main/docs/guide/user/song.md
///
/// 生成したJSONを解放するには ::voicevox_json_free を使う。
///
/// @param [in] synthesizer 音声シンセサイザ
/// @param [in] score_json [`Score`型]を表すJSON
/// @param [in] style_id スタイルID
/// @param [out] output_frame_audio_query_json 生成先
///
/// [`Score`型]: ../rust_api/voicevox_core/struct.Score.html
///
/// @returns 結果コード
///
/// \example{
/// ```c
/// const char *kScore =
/// "{"
/// " \"notes\": [ "
/// " { \"key\": null, \"frame_length\": 15, \"lyric\": \"\" },"
/// " { \"key\": 60, \"frame_length\": 45, \"lyric\": \"ド\" },"
/// " { \"key\": 62, \"frame_length\": 45, \"lyric\": \"レ\" },"
/// " { \"key\": 64, \"frame_length\": 45, \"lyric\": \"ミ\" },"
/// " { \"key\": null, \"frame_length\": 15, \"lyric\": \"\" }"
/// " ]"
/// "}";
/// const VoicevoxStyleId kSingingTeacher = 6000;
///
/// char *frame_audio_query;