Update voice_create.py
Browse files- voice_create.py +9 -0
voice_create.py
CHANGED
|
@@ -42,9 +42,18 @@ def text_to_speech(input_file):
|
|
| 42 |
text = parts[i + 1].strip()
|
| 43 |
text = remove_quotes(text)
|
| 44 |
print("テキスト",text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
# テキスト内の改行を1sの間に変換
|
| 46 |
text = text.replace("\n", '<break time="1s"/>')
|
| 47 |
text = text.replace(".", '.<break time="500ms"/>')
|
|
|
|
|
|
|
| 48 |
# 「,」で時間を空ける
|
| 49 |
if row["eikenn"] in ["5級","4級","3級","準2級","2級"]:
|
| 50 |
text = text.replace(",", '<break time="50ms"/>')
|
|
|
|
| 42 |
text = parts[i + 1].strip()
|
| 43 |
text = remove_quotes(text)
|
| 44 |
print("テキスト",text)
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
# 1sに変換する前に除外するコード
|
| 48 |
+
text = text.replace("a.m.", 'AM')
|
| 49 |
+
text = text.replace("p.m.", 'PM')
|
| 50 |
+
text = text.replace("U.S.", 'US')
|
| 51 |
+
|
| 52 |
# テキスト内の改行を1sの間に変換
|
| 53 |
text = text.replace("\n", '<break time="1s"/>')
|
| 54 |
text = text.replace(".", '.<break time="500ms"/>')
|
| 55 |
+
|
| 56 |
+
|
| 57 |
# 「,」で時間を空ける
|
| 58 |
if row["eikenn"] in ["5級","4級","3級","準2級","2級"]:
|
| 59 |
text = text.replace(",", '<break time="50ms"/>')
|