voicevox_api/models/
mora.rs

1/*
2 * VOICEVOX Engine
3 *
4 * VOICEVOXの音声合成エンジンです。
5 *
6 * The version of the OpenAPI document: 0.14.4
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// Mora : モーラ(子音+母音)ごとの情報
12
13#[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    /// モーラ(子音+母音)ごとの情報
31    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}