-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
30 lines (22 loc) · 920 Bytes
/
main.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
from utils import SocketConnector, JsonConnctor
from t154ru import Addon
import json
settings = json.load(open('settings.json'))
addon = Addon()
voice_connector = SocketConnector(settings['voice_ip'], settings['voice_out'], settings['voice_in'])
sim_connector = SocketConnector(settings['fg_ip'], settings['fg_out'], settings['fg_in'], in_protocol=addon.INPUT_PROTOCOL, out_protocol=addon.OUTPUT_PROTOCOL)
json_sim_connector = JsonConnctor(settings['fg_ip'], settings['fg_phi'])
voice_connector.send_text('Hello')
while True:
voice_text = voice_connector.recieve_str()
addon.update_voice(voice_text)
addon.update(sim_connector.recieve())[1]
json_sim_connector.send(addon.get_props2post())
text = addon.get_text()
if text != '':
print(text)
voice_connector.send_text(text)
#
# import subprocess
# subprocess.run("python3 voice_interface.py & python3 main.py", shell=True)
#