Class: Voicevox::AccentPhrase::Mora
- Inherits:
-
Object
- Object
- Voicevox::AccentPhrase::Mora
- Defined in:
- lib/voicevox/wrapper/audio_query.rb
Overview
モーラ(子音+母音)ごとの情報。
Instance Attribute Summary collapse
-
#consonant ⇒ String
readonly
子音の音素。.
-
#consonant_length ⇒ Float
readonly
子音の音長。.
-
#pitch ⇒ Float
readonly
音高。.
-
#text ⇒ String
readonly
文字。.
-
#vowel ⇒ String
readonly
母音の音素。.
-
#vowel_length ⇒ Float
readonly
母音の音長。.
Instance Method Summary collapse
-
#initialize(query) ⇒ Mora
constructor
A new instance of Mora.
-
#to_hash ⇒ Hash
MoraをHashにします。.
Constructor Details
#initialize(query) ⇒ Mora
Returns a new instance of Mora.
187 188 189 190 191 192 193 194 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 187 def initialize(query) @text = query[:text] @consonant = query[:consonant] @consonant_length = query[:consonant_length] @vowel = query[:vowel] @vowel_length = query[:vowel_length] @pitch = query[:pitch] end |
Instance Attribute Details
#consonant ⇒ String (readonly)
Returns 子音の音素。.
177 178 179 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 177 def consonant @consonant end |
#consonant_length ⇒ Float (readonly)
Returns 子音の音長。.
179 180 181 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 179 def consonant_length @consonant_length end |
#pitch ⇒ Float (readonly)
Returns 音高。.
185 186 187 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 185 def pitch @pitch end |
#text ⇒ String (readonly)
Returns 文字。.
175 176 177 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 175 def text @text end |
#vowel ⇒ String (readonly)
Returns 母音の音素。.
181 182 183 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 181 def vowel @vowel end |
#vowel_length ⇒ Float (readonly)
Returns 母音の音長。.
183 184 185 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 183 def vowel_length @vowel_length end |
Instance Method Details
#to_hash ⇒ Hash
MoraをHashにします。
201 202 203 204 205 206 207 208 209 210 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 201 def to_hash { text: @text, consonant: @consonant, consonant_length: @consonant_length, vowel: @vowel, vowel_length: @vowel_length, pitch: @pitch } end |