Class: Voicevox::AccentPhrase::Mora

Inherits:
Object
  • Object
show all
Defined in:
lib/voicevox/wrapper/audio_query.rb

Overview

モーラ(子音+母音)ごとの情報。

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#consonantString (readonly)

Returns 子音の音素。.

Returns:

  • (String)

    子音の音素。



177
178
179
# File 'lib/voicevox/wrapper/audio_query.rb', line 177

def consonant
  @consonant
end

#consonant_lengthFloat (readonly)

Returns 子音の音長。.

Returns:

  • (Float)

    子音の音長。



179
180
181
# File 'lib/voicevox/wrapper/audio_query.rb', line 179

def consonant_length
  @consonant_length
end

#pitchFloat (readonly)

Returns 音高。.

Returns:

  • (Float)

    音高。



185
186
187
# File 'lib/voicevox/wrapper/audio_query.rb', line 185

def pitch
  @pitch
end

#textString (readonly)

Returns 文字。.

Returns:

  • (String)

    文字。



175
176
177
# File 'lib/voicevox/wrapper/audio_query.rb', line 175

def text
  @text
end

#vowelString (readonly)

Returns 母音の音素。.

Returns:

  • (String)

    母音の音素。



181
182
183
# File 'lib/voicevox/wrapper/audio_query.rb', line 181

def vowel
  @vowel
end

#vowel_lengthFloat (readonly)

Returns 母音の音長。.

Returns:

  • (Float)

    母音の音長。



183
184
185
# File 'lib/voicevox/wrapper/audio_query.rb', line 183

def vowel_length
  @vowel_length
end

Instance Method Details

#to_hashHash

MoraをHashにします。

Returns:

  • (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