|
最近刚在试试homeassistant,想测试下百度的语音服务,已经成功安装播放器,本地可以播放音乐,但测试百度文字转语音时,提示:“ 调用服务 tts/baidu_say 失败 'access_token'”,无法成功播放声音。仔细核对了百度云上面的三个app_id api_key secret_key 又重新复制了一遍,!系统是0.107.5
日志详细信息( ERROR )
Logger: homeassistant.components.websocket_api.http.connection.547729251088
Source: components/baidu/tts.py:124
Integration: websocket_api ([color=var(--primary-color)]documentation, [color=var(--primary-color)]issues)
First occurred: 下午8:31:08 (2 occurrences)
Last logged: 下午8:31:21
'access_token'Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service connection.context(msg), File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1234, in async_call await asyncio.shield(self._execute_service(handler, service_call)) File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1257, in _execute_service await handler.func(service_call) File "/usr/local/lib/python3.7/site-packages/homeassistant/components/tts/__init__.py", line 159, in async_say_handle p_type, message, cache=cache, language=language, options=options File "/usr/local/lib/python3.7/site-packages/homeassistant/components/tts/__init__.py", line 339, in async_get_url engine, key, message, use_cache, language, options File "/usr/local/lib/python3.7/site-packages/homeassistant/components/tts/__init__.py", line 350, in async_get_tts_audio extension, data = await provider.async_get_tts_audio(message, language, options) File "/usr/local/lib/python3.7/site-packages/homeassistant/components/tts/__init__.py", line 510, in async_get_tts_audio ft.partial(self.get_tts_audio, message, language, options=options) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.7/site-packages/homeassistant/components/baidu/tts.py", line 124, in get_tts_audio result = aip_speech.synthesis(message, language, 1, speech_data) File "/usr/local/lib/python3.7/site-packages/aip/speech.py", line 92, in synthesis result = self._request(self.__ttsUrl, data) File "/usr/local/lib/python3.7/site-packages/aip/base.py", line 92, in _request params = self._getParams(authObj) File "/usr/local/lib/python3.7/site-packages/aip/base.py", line 192, in _getParams params['access_token'] = authObj['access_token']KeyError: 'access_token'
|
|