语音模组第一个版本

This commit is contained in:
505030475
2023-07-03 00:13:10 +08:00
parent a330d6636e
commit 2dc8718041
3 changed files with 84 additions and 40 deletions

View File

@@ -2,33 +2,6 @@ import time, threading
class AliyunASR():
def __init__(self):
self.event_on_result_chg = threading.Event()
self.event_on_entence_end = threading.Event()
def test_on_sentence_begin(self, message, *args):
print("test_on_sentence_begin:{}".format(message))
def test_on_sentence_end(self, message, *args):
print("test_on_sentence_end:{}".format(message))
self.event_on_entence_end.set()
def test_on_start(self, message, *args):
print("test_on_start:{}".format(message))
def test_on_error(self, message, *args):
print("on_error args=>{}".format(args))
def test_on_close(self, *args):
print("on_close: args=>{}".format(args))
def test_on_result_chg(self, message, *args):
print("test_on_chg:{}".format(message))
self.parsed_text = message['payload']['result']
self.event_on_result_chg.set()
def test_on_completed(self, message, *args):
print("on_completed:args=>{} message=>{}".format(args, message))
def audio_convertion_thread(self, uuid):
# 在一个异步线程中采集音频