EventMesh.subscribe("sys_up_cb",self.sys_up_cb)#系统唤醒后回调
EventMesh.subscribe("GET_USB_STATE",self.get_usb_state)
- EventMesh.subscribe("SET_TTS_VOLUME",self.set_tts_volume)
EventMesh.subscribe("SET_SPEECH_RATE",self.set_speech_rate)
print("AI_dev:2")
#self.aud.play(1,1,'U:/static/R_CHARGE_OUT.mp3')
def get_usb_state(self,event,msg):
return self.usb_status
- def set_tts_volume(self,event,msg):
- EventMesh.publish("set_storage_config",["VC_TTS_volume",msg])#音量配置
- self.VC_TTS_volume = msg
- self.aud.setVolume(self.VC_TTS_volume //10)
- pass
+
def set_speech_rate(self,event,msg):
self.speech_rate = msg
EventMesh.publish("set_storage_config",["speech_rate",self.speech_rate])
EventMesh.subscribe("audio_test_close", self.audio_test_close)
EventMesh.subscribe("set_record_data_save_flag", self.set_record_data_save_flag)
EventMesh.subscribe("set_VC_TTS_voice_type", self.set_VC_TTS_voice_type)
-
+ EventMesh.subscribe("SET_TTS_VOLUME", self.set_tts_volume)
+ pass
EventMesh.publish("close_led")
self.dialog_attributes_provider = EventMesh.publish("get_storage_config","dialog_attributes_provider")#智能体类型配置
if self.dialog_attributes_provider == None:
self.audio_play_state = 0
#EventMesh.publish("set_audio_state", 0)
print('audio-play finish.!!!!!!')
-
+ def set_tts_volume(self,event,msg):
+ EventMesh.publish("set_storage_config",["VC_TTS_volume",msg])#音量配置
+ self.VC_TTS_volume = msg
+ print("set_tts_volume:{} {}".format(self.VC_TTS_volume,msg))
+ self.aud.setVolume(self.VC_TTS_volume //10)
+ pass
def AI_key_press(self, event=None, msg = None):#按键按下
if self.voice_flag == 1: #语音留言模式
# EventMesh.publish("stop_AI_record")