Skip to content

Commit

Permalink
疑似疑問文化をsynthesis APIの直前に移動 (#310)
Browse files Browse the repository at this point in the history
* append interrogative mora just before synthesis

* parse_kana should not append interrogative mora
  • Loading branch information
Yosshi999 authored and Hiroshiba committed Jan 28, 2022
1 parent 4030702 commit ceef0ca
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 135 deletions.
5 changes: 1 addition & 4 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
)
from voicevox_engine.preset import Preset, PresetLoader
from voicevox_engine.synthesis_engine import SynthesisEngineBase, make_synthesis_engine
from voicevox_engine.synthesis_engine.synthesis_engine_base import (
adjust_interrogative_accent_phrases,
)
from voicevox_engine.utility import ConnectBase64WavesException, connect_base64_waves


Expand Down Expand Up @@ -196,7 +193,7 @@ def accent_phrases(
accent_phrases=accent_phrases, speaker_id=speaker
)

return adjust_interrogative_accent_phrases(accent_phrases)
return accent_phrases
else:
return engine.create_accent_phrases(
text,
Expand Down
20 changes: 0 additions & 20 deletions test/test_kana_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,16 +441,6 @@ def a_question_mark_accent_phrases():

expected_accent_phrases = a_question_mark_accent_phrases()
expected_accent_phrases[-1].is_interrogative = True
expected_accent_phrases[-1].moras.append(
Mora(
text="ア",
consonant=None,
consonant_length=None,
vowel="a",
vowel_length=0.0,
pitch=0.0,
)
)
self._interrogative_accent_phrase_marks_base(
text="ア'?",
enable_interrogative=True,
Expand Down Expand Up @@ -519,16 +509,6 @@ def gye_gye_gye_question_mark_accent_phrases():

expected_accent_phrases = gye_gye_gye_question_mark_accent_phrases()
expected_accent_phrases[-1].is_interrogative = True
expected_accent_phrases[-1].moras.append(
Mora(
text="エ",
consonant=None,
consonant_length=None,
vowel="e",
vowel_length=0.0,
pitch=0.0,
)
)
self._interrogative_accent_phrase_marks_base(
text="ギェ'、ギェ'/ギェ'?",
enable_interrogative=True,
Expand Down
Loading

0 comments on commit ceef0ca

Please sign in to comment.