-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcheck1.py
34 lines (29 loc) · 983 Bytes
/
check1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3
import asyncio
from msspeech import MSSpeech
async def main():
mss = MSSpeech()
# print("Geting voices...")
# voices = await mss.get_voices_list()
# print("searching Russian voice...")
# for voice in voices:
# if voice["Locale"] == "ru-RU":
# print("Russian voice found:", voice["FriendlyName"])
# await mss.set_voice(voice["Name"])
await mss.set_voice("ru-RU-DmitryNeural")
print("*" * 10)
filename = "full.mp3"
with open("s.txt", encoding="UTF8") as f:
text: str = f.read()
text = "В новой версии вернули Димана, а Дашу нет!"
print("waiting...")
await mss.set_rate(10)
await mss.set_pitch(0)
await mss.set_volume(1.0)
await mss.synthesize(text.strip(), filename)
print("*" * 10)
print("SUCCESS! OK!")
print("*" * 10)
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())