add VOICEVOX structs

This commit is contained in:
mii
2022-08-09 21:38:57 +09:00
parent 02b2877f8c
commit aed82b1348
5 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1 @@
pub mod structs;

View File

@ -0,0 +1,11 @@
use serde::{Serialize, Deserialize};
use super::mora::Mora;
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct AccentPhrase {
pub moras: Vec<Mora>,
pub accent: f64,
pub pause_mora: Option<Mora>,
pub is_interrogative: bool
}

View File

@ -0,0 +1,18 @@
use serde::{Serialize, Deserialize};
use super::accent_phrase::AccentPhrase;
#[allow(non_snake_case)]
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct AudioQuery {
pub accent_phrases: Vec<AccentPhrase>,
pub speedScale: f64,
pub pitchScale: f64,
pub intonationScale: f64,
pub volumeScale: f64,
pub prePhonemeLength: f64,
pub postPhonemeLength: f64,
pub outputSamplingRate: f64,
pub outputStereo: bool,
pub kana: Option<String>
}

View File

@ -0,0 +1,3 @@
pub mod mora;
pub mod audio_query;
pub mod accent_phrase;

View File

@ -0,0 +1,11 @@
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct Mora {
pub text: String,
pub consonant: Option<String>,
pub consonant_length: Option<f64>,
pub vowel: String,
pub vowel_length: f64,
pub pitch: f64
}