Skip to content

Commit

Permalink
音声の前の無音を長くする機能を削除する (#292)
Browse files Browse the repository at this point in the history
* 音声の前の無音を長くする機能を削除する

* テスト落ちてた
  • Loading branch information
Hiroshiba committed Jan 23, 2022
1 parent 80eb9fa commit 5f7ea1a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
5 changes: 0 additions & 5 deletions test/test_synthesis_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,6 @@ def synthesis_test_base(self, audio_query: AudioQuery):
for i in range(len(phoneme_length_list)):
phoneme_length_list[i] /= audio_query.speedScale

pre_padding_length = 0.4
phoneme_length_list[0] += pre_padding_length

result = self.synthesis_engine.synthesis(query=audio_query, speaker_id=1)

# decodeに渡される値の検証
Expand Down Expand Up @@ -573,8 +570,6 @@ def synthesis_test_base(self, audio_query: AudioQuery):
true_result = decode_mock(list_length, num_phoneme, f0, phoneme, 1)

true_result *= audio_query.volumeScale
# pre padding length分を切り取る
true_result = true_result[int(24000 * pre_padding_length) :]

# TODO: resampyの部分は値の検証しようがないので、パスする
if audio_query.outputSamplingRate != 24000:
Expand Down
7 changes: 0 additions & 7 deletions voicevox_engine/synthesis_engine/synthesis_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,6 @@ def synthesis(self, query: AudioQuery, speaker_id: int):
# lengthにSpeed Scale(話速)を適用する
phoneme_length /= query.speedScale

# TODO: 前の無音を少し長くすると最初のワードが途切れないワークアラウンド実装
pre_padding_length = 0.4
phoneme_length[0] += pre_padding_length

# pitch
# モーラの音高(ピッチ)を展開・結合し、floatにキャストする
f0_list = [0] + [mora.pitch for mora in flatten_moras] + [0]
Expand Down Expand Up @@ -450,9 +446,6 @@ def synthesis(self, query: AudioQuery, speaker_id: int):
speaker_id=numpy.array(speaker_id, dtype=numpy.int64).reshape(-1),
)

# TODO: 前の無音を少し長くすると最初のワードが途切れないワークアラウンド実装の後処理
wave = wave[int(self.default_sampling_rate * pre_padding_length) :]

# volume: ゲイン適用
wave *= query.volumeScale

Expand Down

0 comments on commit 5f7ea1a

Please sign in to comment.