voicevox_api/models/
mora.rs1#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct Mora {
15 #[serde(rename = "text")]
16 pub text: String,
17 #[serde(rename = "consonant", skip_serializing_if = "Option::is_none")]
18 pub consonant: Option<String>,
19 #[serde(rename = "consonant_length", skip_serializing_if = "Option::is_none")]
20 pub consonant_length: Option<f32>,
21 #[serde(rename = "vowel")]
22 pub vowel: String,
23 #[serde(rename = "vowel_length")]
24 pub vowel_length: f32,
25 #[serde(rename = "pitch")]
26 pub pitch: f32,
27}
28
29impl Mora {
30 pub fn new(text: String, vowel: String, vowel_length: f32, pitch: f32) -> Mora {
32 Mora {
33 text,
34 consonant: None,
35 consonant_length: None,
36 vowel,
37 vowel_length,
38 pitch,
39 }
40 }
41}