Skip to main content

piper_plus/
lib.rs

1//! Piper-Plus 推論コアライブラリ
2//!
3//! VITS ベースのニューラル TTS 推論エンジン。
4//! ONNX Runtime を使用し、7 言語 (JA/EN/ZH/KO/ES/FR/PT) に対応。
5//!
6//! Phase 4 追加機能:
7//! - ストリーミング合成 (`streaming`)
8//! - リアルタイム再生 (`playback`, feature-gated)
9//! - 音素タイミング (`timing`)
10//! - GPU 推論 (`gpu`)
11//! - WASM 互換 API (`wasm`)
12//! - モデルダウンロード (`model_download`)
13//! - 音声フォーマット変換 (`audio_format`)
14//! - テキスト分割 (`text_splitter`)
15//! - バッチ合成 (`batch`)
16//! - デバイス列挙 (`device`)
17
18// --- Core modules (常に有効) ---
19pub mod audio;
20pub mod config;
21pub mod dictionary_manager;
22pub mod error;
23pub mod phonemize;
24
25// --- Inference-dependent modules ---
26#[cfg(feature = "onnx")]
27pub mod batch;
28#[cfg(feature = "onnx")]
29pub mod device;
30#[cfg(feature = "onnx")]
31pub mod engine;
32#[cfg(feature = "onnx")]
33pub mod gpu;
34#[cfg(feature = "onnx")]
35pub mod input;
36#[cfg(feature = "onnx")]
37pub mod voice;
38#[cfg(feature = "onnx")]
39pub mod wasm;
40
41// --- Phase 4 modules (推論非依存) ---
42pub mod audio_format;
43pub mod model_download;
44pub mod streaming;
45pub mod text_splitter;
46pub mod timing;
47
48pub mod playback;
49
50// Re-exports
51pub use config::{PhonemeIdMap, PhonemeType, VoiceConfig};
52#[cfg(feature = "onnx")]
53pub use engine::{
54    DEFAULT_WARMUP_RUNS, ModelCapabilities, OnnxEngine, SynthesisRequest, SynthesisResult,
55};
56pub use error::PiperError;
57pub use phonemize::{ProsodyFeature, ProsodyInfo};
58#[cfg(feature = "onnx")]
59pub use voice::PiperVoice;