vvcore/
lib.rs

1//! # FFI Bindings for VOICEVOX CORE.
2//!
3//! This is an unofficial Rust FFI wrapper for VOICEVOX CORE.
4//!
5//! # APIs
6//!
7//! It provides a high-level API for calling VOICEVOX CORE.
8//!
9//!  - [VoicevoxCore]
10//!
11//!
12//! It also provides a low-level API for directly calling the ffi provided by VOICEVOX CORE.
13//!
14//!  - [api](api/index.html#functions)
15//!
16//! # Example
17//!
18//! ```
19//! use std::io::Write;
20//! use vvcore::*;
21//!
22//! let dir = std::ffi::CString::new("./voicevox_core/open_jtalk_dic_utf_8-1.11").unwrap();
23//! let vvc = VoicevoxCore::new_from_options(AccelerationMode::Auto, 0, true, dir.as_c_str()).unwrap();
24//!
25//! let text: &str = "こんにちは";
26//! let speaker: u32 = 1;
27//! let wav = vvc.tts_simple(text, speaker).unwrap();
28//!
29//! let mut file = std::fs::File::create("audio.wav").unwrap();
30//! file.write_all(&wav.as_slice()).unwrap();
31//! ```
32
33pub mod api;
34
35pub use self::api::{
36    VoicevoxCore,
37    ResultCode,
38    AccelerationMode,
39    CPointerWrap,
40    CStrWrap,
41    InitializeOptions,
42    AudioQueryOptions,
43    SynthesisOptions,
44    TtsOptions,
45};