Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nomissbowling/voicevox-rs
VOICEVOX Client library for Rust
https://github.com/nomissbowling/voicevox-rs
Last synced: about 1 month ago
JSON representation
VOICEVOX Client library for Rust
- Host: GitHub
- URL: https://github.com/nomissbowling/voicevox-rs
- Owner: nomissbowling
- License: mit
- Created: 2023-08-22T13:24:19.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-08-29T06:46:01.000Z (over 1 year ago)
- Last Synced: 2024-11-09T08:43:10.363Z (about 2 months ago)
- Language: Rust
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
voicevox-rs
===========VOICEVOX Client library for Rust
```rust
let vvc = VVClient::new();
vvc.display_speakers().unwrap(); // show all speaker characters
let Some(id) = vvc.speaker("ずんだもん", "ノーマル") else { panic!("id") };
let qs = vvc.query("ずんだもんなのだ。", id).unwrap();
let dat = vvc.synth(qs, id).unwrap();
vvc.speak(dat, 3).unwrap(); // always 3 seconds
``````rust
let vvc = VVClient::new();
let characters: Vec<(&str, &str)> = vec![
("雨晴はう", "ノーマル"),
("春日部つむぎ", "ノーマル"),
("四国めたん", "ノーマル"),
("四国めたん", "あまあま"),
("ずんだもん", "ノーマル"),
("小夜/SAYO", "ノーマル"),
("猫使アル", "ノーマル"),
("猫使アル", "おちつき"),
("猫使アル", "うきうき"),
("猫使ビィ", "ノーマル"),
("猫使ビィ", "おちつき"),
("猫使ビィ", "人見知り")];
for chara in characters {
let Some(id) = vvc.speaker(chara.0, chara.1) else { panic!("id") };
let qs = vvc.query(format!("{}です{}なのです",
chara.0, chara.1).as_str(), id).unwrap();
let mut ps = vvc.phrases(&qs).unwrap();
let dat = vvc.synth(qs, id).unwrap();
vvc.speak(dat, 0).unwrap(); // append to buffer
ps.speedScale = 1.5;
let dat = vvc.synth(vvc.phrases_to_str(&ps).unwrap(), id).unwrap();
vvc.speak(dat, 0).unwrap(); // append to buffer
}
vvc.speak_flush().unwrap(); // must call it after speak 0
```Requirements
============- [VOICEVOX (v0.14.7)]( https://voicevox.hiroshiba.jp/ )
License
=======MIT