|
|
@@ -166,6 +166,7 @@ async def record_microphone():
|
|
|
async def record_from_scp(chunk_begin, chunk_size):
|
|
|
global voices
|
|
|
is_finished = False
|
|
|
+ print(f"args: {args}")
|
|
|
if args.audio_in.endswith(".scp"):
|
|
|
f_scp = open(args.audio_in)
|
|
|
wavs = f_scp.readlines()
|
|
|
@@ -191,7 +192,7 @@ async def record_from_scp(chunk_begin, chunk_size):
|
|
|
hotword_msg = json.dumps(fst_dict)
|
|
|
else:
|
|
|
hotword_msg = args.hotword
|
|
|
- print (hotword_msg)
|
|
|
+ print ("hotword_msg: ", hotword_msg)
|
|
|
|
|
|
sample_rate = args.audio_fs
|
|
|
wav_format = "pcm"
|
|
|
@@ -241,6 +242,7 @@ async def record_from_scp(chunk_begin, chunk_size):
|
|
|
"itn": use_itn})
|
|
|
|
|
|
#voices.put(message)
|
|
|
+ print("send message")
|
|
|
await websocket.send(message)
|
|
|
is_speaking = True
|
|
|
for i in range(chunk_num):
|
|
|
@@ -362,6 +364,7 @@ async def ws_client(id, chunk_begin, chunk_size, proc_args=None):
|
|
|
print("connect to", uri)
|
|
|
async with websockets.connect(uri, subprotocols=["binary"], ping_interval=None, ssl=ssl_context) as websocket:
|
|
|
if args.audio_in is not None:
|
|
|
+ print(f"i = {i}")
|
|
|
task = asyncio.create_task(record_from_scp(i, 1))
|
|
|
else:
|
|
|
task = asyncio.create_task(record_microphone())
|