Skip to content

Commit

Permalink
時系列を列に、" "を" "に
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Dec 6, 2023
1 parent 25ffccb commit c2275d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions test/test_synthesis_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ def test_pad_with_silence():

# Expects
true_moras_with_silence = [
_gen_mora(" ", None, None, "sil", 2 * 0.01067, 0.0),
_gen_mora(" ", None, None, "sil", 2 * 0.01067, 0.0),
_gen_mora("ヒ", "h", 2 * 0.01067, "i", 4 * 0.01067, 100.0),
_gen_mora(" ", None, None, "sil", 6 * 0.01067, 0.0),
_gen_mora(" ", None, None, "sil", 6 * 0.01067, 0.0),
]

# Outputs
Expand All @@ -195,13 +195,13 @@ def test_calc_frame_per_phoneme():
# Inputs
query = _gen_query(speedScale=2.0)
moras = [
_gen_mora(" ", None, None, " ", 2 * 0.01067, 0.0), # 0.01067 [sec/frame]
_gen_mora(" ", None, None, " ", 2 * 0.01067, 0.0), # 0.01067 [sec/frame]
_gen_mora("コ", "k", 2 * 0.01067, "o", 4 * 0.01067, 0.0),
_gen_mora("ン", None, None, "N", 4 * 0.01067, 0.0),
_gen_mora("、", None, None, "pau", 2 * 0.01067, 0.0),
_gen_mora("ヒ", "h", 2 * 0.01067, "i", 4 * 0.01067, 0.0),
_gen_mora("ホ", "h", 4 * 0.01067, "O", 2 * 0.01067, 0.0),
_gen_mora(" ", None, None, " ", 6 * 0.01067, 0.0),
_gen_mora(" ", None, None, " ", 6 * 0.01067, 0.0),
]

# Expects
Expand All @@ -220,13 +220,13 @@ def test_calc_frame_pitch():
# Inputs
query = _gen_query(pitchScale=2.0, intonationScale=0.5)
moras = [
_gen_mora(" ", None, None, " ", 0.0, 0.0),
_gen_mora(" ", None, None, " ", 0.0, 0.0),
_gen_mora("コ", "k", 0.0, "o", 0.0, 50.0),
_gen_mora("ン", None, None, "N", 0.0, 50.0),
_gen_mora("、", None, None, "pau", 0.0, 0.0),
_gen_mora("ヒ", "h", 0.0, "i", 0.0, 125.0),
_gen_mora("ホ", "h", 0.0, "O", 0.0, 0.0),
_gen_mora(" ", None, None, " ", 0.0, 0.0),
_gen_mora(" ", None, None, " ", 0.0, 0.0),
]
phoneme_str = "pau k o N pau h i h O pau"
phonemes = [OjtPhoneme(p, 0, 0) for p in phoneme_str.split()]
Expand Down
6 changes: 3 additions & 3 deletions voicevox_engine/synthesis_engine/synthesis_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ def pre_process(
Returns
-------
flatten_moras : List[Mora]
モーラ時系列(前後の無音含まない)
モーラ列(前後の無音含まない)
phoneme_data_list : List[OjtPhoneme]
音素時系列(前後の無音含む)
音素列(前後の無音含む)
"""
flatten_moras = to_flatten_moras(accent_phrases)

Expand All @@ -112,7 +112,7 @@ def pre_process(

def generate_silence_mora(length: float) -> Mora:
"""無音モーラの生成"""
return Mora(text=" ", vowel="sil", vowel_length=length, pitch=0.0)
return Mora(text=" ", vowel="sil", vowel_length=length, pitch=0.0)


def pad_with_silence(moras: list[Mora], query: AudioQuery) -> list[Mora]:
Expand Down

0 comments on commit c2275d0

Please sign in to comment.