win10环境下下载python sdk并配置完服务端需要的设置,初次运行的时候在命令行执行python tests/test_tts/py
文件, 生成了test_tts.pcm
文件且输出信息如下
thread:thread0 start..
thread0: session start
2022-05-12 10:22:17,902 - DEBUG - callback args:[]
2022-05-12 10:22:18,038 - DEBUG - get token 28843902abe946b486d0039e5e5b1ac2
2022-05-12 10:22:18,039 - DEBUG - ws run...
2022-05-12 10:22:18,039 - DEBUG - wait cond wakeup
2022-05-12 10:22:18,152 - DEBUG - core_on_open:(<nls._core.NlsCore object at 0x000002130F03CCD0>, '{"header": {"message_id": "cd6a7d2a6d3941bdae56d4030c3e6605", "task_id": "1cb0c2a08e5148ea862bdc67103ca047", "namespace": "SpeechSynthesizer", "name": "StartSynthesis", "appkey": "rBjTtVQwMUzU7pjD"}, "payload": {"text": "\\u5927\\u58ee\\u6b63\\u60f3\\u53bb\\u6458\\u53d6\\u82b1\\u74e3\\uff0c\\u8c01\\u77e5\\u963f\\u4e3d\\u548c\\u963f\\u5f3a\\u7a81\\u7136\\u5185\\u8ba7\\uff0c\\u963f\\u4e3d\\u62ff\\u53bb\\u624b\\u67aa\\u5411\\u6811\\u5e72\\u8fb9\\u7684\\u963f\\u5f3a\\u5c04\\u51fb\\uff0c\\u4e24\\u58f0\\u67aa\\u54cd\\uff0c\\u963f\\u5f3a\\u76f4\\u63a5\\u5012\\u5165\\u6c34\\u4e2d", "voice": "ailun", "format": "pcm", "sample_rate": 16000, "volume": 50, "speech_rate": 0, "pitch_rate": 0}}')
2022-05-12 10:22:20,535 - DEBUG - core_on_msg:{"header":{"namespace":"SpeechSynthesizer","name":"SynthesisCompleted","status":20000000,"message_id":"43cd7a65da94408db1d203b2eacd0765","task_id":"1cb0c2a08e5148ea862bdc67103ca047","status_text":"Gateway:SUCCESS:Success."}}
2022-05-12 10:22:20,536 - DEBUG - __syn_core_on_msg:msg={"header":{"namespace":"SpeechSynthesizer","name":"SynthesisCompleted","status":20000000,"message_id":"43cd7a65da94408db1d203b2eacd0765","task_id":"1cb0c2a08e5148ea862bdc67103ca047","status_text":"Gateway:SUCCESS:Success."}} args=()
2022-05-12 10:22:20,536 - DEBUG - __handle_message
2022-05-12 10:22:20,536 - DEBUG - __synthesis_completed
2022-05-12 10:22:20,559 - DEBUG - __synthesis_completed shutdown done
on_completed:args=>('thread0',) message=>{"header":{"namespace":"SpeechSynthesizer","name":"SynthesisCompleted","status":20000000,"message_id":"43cd7a65da94408db1d203b2eacd0765","task_id":"1cb0c2a08e5148ea862bdc67103ca047","status_text":"Gateway:SUCCESS:Success."}}
2022-05-12 10:22:20,560 - DEBUG - core_on_close
thread0: tts done with result:True
2022-05-12 10:22:20,560 - DEBUG - __sr_core_on_close
on_close: args=>('thread0',)
2022-05-12 10:22:20,561 - DEBUG - ws exit...
通过对比文档已知此次执行结果为正常,但疑问如下
test_tts.py
内的语句t = TestTts(name, "tests/test_tts.pcm")
,但改变后缀名的方法无效 。尝试修改nls/ _speech_synthesizer.py
内的
def start(self, text="", voice="xiaoyun", aformat="pcm",
类型为wav,同样无效 2. 执行语句后线程一直处于循环执行,虽然通过修改while语句的值可以终止执行。但想了解如何通过控制线程来终止线程执行
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。