| 
 3463| 6
 | [求助] [已解决]行空板不能播放语音合成的文件音频 | 
| from unihiker import * from pinpong.board import * from aip import AipSpeech import json audio = Audio() cilent = AipSpeech("","","") text = cilent.synthesis("你好", "zh", 1, {"vol": 5,"spd": 5,"pit": 3,"per": 0}) with open("record.mp3","wb") as fp: fp.write(str(text).decode()) audio.play("record.mp3") Board().begin() pin1 = Pin(Pin.D24,Pin.IN) dht = DHT11(pin1) gui = GUI() t = gui.draw_text(text=dht.temp_c(),x=0,y=0,color="#0000FF") while True: t.config(text=dht.humidity()) | 
| 解决了,是网络问题,请求不到<div class="reference"><p><a href="https://mc.dfrobot.com.cn/home.php?mod=space&uid=857409&do=profile" target="_blank">刘骏森</a> 2024-03-03 09:43:22<p><div class="quote">代码发错了,第11行fp.write(str(text).encode())改成fp.write(json.dumps(text).encode())</div></div> | 
 沪公网安备31011502402448
 沪公网安备31011502402448© 2013-2025 Comsenz Inc. Powered by Discuz! X3.4 Licensed