Class: Voicevox::AudioQuery
- Inherits:
-
Object
- Object
- Voicevox::AudioQuery
- Defined in:
- lib/voicevox/wrapper/audio_query.rb
Overview
音声合成用のクエリ。
Instance Attribute Summary collapse
-
#accent_phrases ⇒ Array<AccentPhrase>
アクセント句のリスト。.
-
#intonation_scale ⇒ Float
全体の抑揚。.
-
#kana ⇒ String
readonly
AquesTalkライクな読み仮名。.
-
#output_sampling_rate ⇒ Integer
音声データの出力サンプリングレート。.
-
#output_stereo ⇒ Boolean
音声データをステレオ出力するか否か。.
-
#pitch_scale ⇒ Float
全体の音高。.
-
#post_phoneme_length ⇒ Float
音声の後の無音時間。.
-
#pre_phoneme_length ⇒ Float
音声の前の無音時間。.
-
#speed_scale ⇒ Float
全体の話速。.
-
#volume_scale ⇒ Float
全体の音量。.
Instance Method Summary collapse
-
#initialize(query) ⇒ AudioQuery
constructor
A new instance of AudioQuery.
-
#to_hash ⇒ Hash
AudioQueryをHashにします。.
-
#to_json ⇒ String
AudioQueryをjsonにします。.
Constructor Details
#initialize(query) ⇒ AudioQuery
Returns a new instance of AudioQuery.
92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 92 def initialize(query) @accent_phrases = query[:accent_phrases].map { |ap| AccentPhrase.new ap } @speed_scale = query[:speed_scale] @pitch_scale = query[:pitch_scale] @intonation_scale = query[:intonation_scale] @volume_scale = query[:volume_scale] @pre_phoneme_length = query[:pre_phoneme_length] @post_phoneme_length = query[:post_phoneme_length] @output_sampling_rate = query[:output_sampling_rate] @output_stereo = query[:output_stereo] @kana = query[:kana] end |
Instance Attribute Details
#accent_phrases ⇒ Array<AccentPhrase>
Returns アクセント句のリスト。.
72 73 74 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 72 def accent_phrases @accent_phrases end |
#intonation_scale ⇒ Float
Returns 全体の抑揚。.
78 79 80 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 78 def intonation_scale @intonation_scale end |
#kana ⇒ String (readonly)
Returns AquesTalkライクな読み仮名。.
90 91 92 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 90 def kana @kana end |
#output_sampling_rate ⇒ Integer
Returns 音声データの出力サンプリングレート。.
86 87 88 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 86 def output_sampling_rate @output_sampling_rate end |
#output_stereo ⇒ Boolean
Returns 音声データをステレオ出力するか否か。.
88 89 90 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 88 def output_stereo @output_stereo end |
#pitch_scale ⇒ Float
Returns 全体の音高。.
76 77 78 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 76 def pitch_scale @pitch_scale end |
#post_phoneme_length ⇒ Float
Returns 音声の後の無音時間。.
84 85 86 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 84 def post_phoneme_length @post_phoneme_length end |
#pre_phoneme_length ⇒ Float
Returns 音声の前の無音時間。.
82 83 84 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 82 def pre_phoneme_length @pre_phoneme_length end |
#speed_scale ⇒ Float
Returns 全体の話速。.
74 75 76 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 74 def speed_scale @speed_scale end |
#volume_scale ⇒ Float
Returns 全体の音量。.
80 81 82 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 80 def volume_scale @volume_scale end |
Instance Method Details
#to_hash ⇒ Hash
AudioQueryをHashにします。
110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 110 def to_hash { accent_phrases: @accent_phrases.map(&:to_hash), pitch_scale: @pitch_scale, speed_scale: @speed_scale, intonation_scale: @intonation_scale, volume_scale: @volume_scale, pre_phoneme_length: @pre_phoneme_length, post_phoneme_length: @post_phoneme_length, output_sampling_rate: @output_sampling_rate, output_stereo: @output_stereo, kana: @kana } end |
#to_json ⇒ String
AudioQueryをjsonにします。
130 131 132 |
# File 'lib/voicevox/wrapper/audio_query.rb', line 130 def to_json(...) to_hash.to_json(...) end |