This commit is contained in:
tuna2134
2023-04-08 16:15:53 +09:00
parent afc781e8c4
commit 38419643b9
3 changed files with 7 additions and 6 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/target /target
/Cargo.lock /Cargo.lock
*.wav

View File

@ -1,4 +1,5 @@
use voicevox_client::Client; use voicevox_client::Client;
use std::{io::Write, fs::File};
#[tokio::main] #[tokio::main]
async fn main() { async fn main() {
@ -8,5 +9,6 @@ async fn main() {
.await .await
.unwrap(); .unwrap();
let audio = audio_query.synthesis(1).await.unwrap(); let audio = audio_query.synthesis(1).await.unwrap();
println!("audio: {:?}", audio); let mut file = File::create("examples/hello.wav").unwrap();
file.write_all(&audio).unwrap();
} }

View File

@ -4,9 +4,9 @@ use serde::{Deserialize, Serialize};
pub struct Mora { pub struct Mora {
text: String, text: String,
#[serde(default)] #[serde(default)]
consonant: String, consonant: Option<String>,
#[serde(default)] #[serde(default)]
consonant_length: f32, consonant_length: Option<f32>,
vowel: String, vowel: String,
vowel_length: f32, vowel_length: f32,
pitch: f32, pitch: f32,
@ -14,13 +14,11 @@ pub struct Mora {
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct AccentPhrase { pub struct AccentPhrase {
// moras: Vec<Mora>, moras: Vec<Mora>,
accent: i32, accent: i32,
// pause_mora: Mora, // pause_mora: Mora,
/*
#[serde(default)] #[serde(default)]
is_interrogative: bool, is_interrogative: bool,
*/
} }
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]