mirror of
https://github.com/mii443/rust.git
synced 2025-08-22 16:25:37 +00:00
pkay
This commit is contained in:
11
README.md
11
README.md
@ -3,16 +3,17 @@
|
|||||||
## Example
|
## Example
|
||||||
```rust
|
```rust
|
||||||
use voicevox_client::Client;
|
use voicevox_client::Client;
|
||||||
|
use std::{io::Write, fs::File};
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
let client = Client::new("http://localhost:50021".to_string());
|
let client = Client::new("http://localhost:50021".to_string());
|
||||||
let audio_query = client.create_audio_query("hello", 1)
|
let audio_query = client
|
||||||
.await
|
.create_audio_query("こんにちは", 1, None)
|
||||||
.unwrap();
|
|
||||||
let bytes = audio_query.synthesis(1)
|
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
let audio = audio_query.synthesis(1).await.unwrap();
|
||||||
|
let mut file = File::create("examples/hello.wav").unwrap();
|
||||||
|
file.write_all(&audio).unwrap();
|
||||||
}
|
}
|
||||||
```
|
```
|
Reference in New Issue
Block a user