-
Notifications
You must be signed in to change notification settings - Fork 3
/
make_mp3_3.py
21 lines (16 loc) · 935 Bytes
/
make_mp3_3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from gtts import gTTS
import yaml
import os
import numpy as np
with open('speak_info.yaml') as f:
korean_agri_name = yaml.load(f, Loader=yaml.FullLoader)
# def cr(eng, direction, distance):
# tts = gTTS(text=eng + str(direction) +"시 방향"+ str(distance) + "미터 거리에 있어요", lang='ko')
# tts.save(os.path.join('./mp3_dir', eng + str(direction) + str(distance)[0] + str(distance)[2] + ".mp4"))
for eng in korean_agri_name.keys():
for direction in [3]:
for distance in list(np.arange(0, 10, 0.1)):
tts = gTTS(text=eng + str(direction) +"시 방향"+ str(distance)[:3] + "미터 거리에 있어요", lang='ko')
tts.save(os.path.join('./mp3_dir', eng + str(direction) + str(distance)[0] + str(distance)[2] + ".mp4"))
# for name in names:
# tts = gTTS(text=korean_agri_name[names[c]] + direction +"시 방향"+ str(distance)[:3] + "미터 거리에 있어요", lang='ko')