『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
楼主: anlong

[技术讨论] 基于Edge浏览器的微软TTS插件,无需app_key

  [复制链接]

6

主题

267

帖子

2381

积分

论坛技术达人

积分
2381
金钱
2094
HASS币
90
 楼主| 发表于 2022-5-17 12:33:54 | 显示全部楼层
囧 发表于 2022-5-16 12:00
大佬,俺这一直运行不了,更新了新版也不成,提示如下,求解啊,好像是连接不上speech.platform.bing.com  ...
nslookup speech.platform.bing.com
curl -v https://speech.platform.bing.com

检查下dns和时区。
参考:https://github.com/al-one/hass-xiaomi-miot/issues/500


小米MIoT插件:miot-spec.com
回复

使用道具 举报

123

主题

4664

帖子

1万

积分

管理员

囧死

Rank: 9Rank: 9Rank: 9

积分
16442
金钱
11693
HASS币
45
发表于 2022-5-16 12:00:03 | 显示全部楼层
大佬,俺这一直运行不了,更新了新版也不成,提示如下,求解啊,好像是连接不上speech.platform.bing.com 这个网站


Logger: homeassistant.helpers.script.websocket_api_script
Source: custom_components/edge_tts/tts.py:185
Integration: edge_tts (documentation, issues)
First occurred: 11:57:46 (1 occurrences)
Last logged: 11:57:46

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: Cannot connect to host speech.platform.bing.com:443 ssl:default [Try again]
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 999, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 865, in _resolve_host
    addrs = await self._resolver.resolve(host, port, family=self._family)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/resolver.py", line 31, in resolve
    infos = await self._loop.getaddrinfo(
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 856, in getaddrinfo
    return await self.run_in_executor(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/socket.py", line 953, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 371, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 571, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1491, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1526, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 185, in async_say_handle
    url = await tts.async_get_url_path(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 373, in async_get_url_path
    filename = await self.async_get_tts_audio(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 385, in async_get_tts_audio
    extension, data = await provider.async_get_tts_audio(message, language, options)
  File "/config/custom_components/edge_tts/tts.py", line 185, in async_get_tts_audio
    async for i in tts.run(
  File "/usr/local/lib/python3.9/site-packages/edge_tts/communicate.py", line 259, in run
    async with session.ws_connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1117, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 754, in _ws_connect
    resp = await self.request(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 520, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 535, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 892, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1011, in _create_direct_connection
    raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host speech.platform.bing.com:443 ssl:default [Try again]

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/edge_tts/tts.py:185
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 11:57:46 (1 occurrences)
Last logged: 11:57:46

[139867530924768] Error handling message: Unknown error
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 999, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 865, in _resolve_host
    addrs = await self._resolver.resolve(host, port, family=self._family)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/resolver.py", line 31, in resolve
    infos = await self._loop.getaddrinfo(
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 856, in getaddrinfo
    return await self.run_in_executor(
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/socket.py", line 953, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 25, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 525, in handle_execute_script
    await script_obj.async_run(msg.get("variables"), context=context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1219, in async_run
    await asyncio.shield(run.async_run())
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 353, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 371, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 571, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1491, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1526, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 185, in async_say_handle
    url = await tts.async_get_url_path(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 373, in async_get_url_path
    filename = await self.async_get_tts_audio(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 385, in async_get_tts_audio
    extension, data = await provider.async_get_tts_audio(message, language, options)
  File "/config/custom_components/edge_tts/tts.py", line 185, in async_get_tts_audio
    async for i in tts.run(
  File "/usr/local/lib/python3.9/site-packages/edge_tts/communicate.py", line 259, in run
    async with session.ws_connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1117, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 754, in _ws_connect
    resp = await self.request(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 520, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 535, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 892, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1011, in _create_direct_connection
    raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host speech.platform.bing.com:443 ssl:default [Try again]



回复

使用道具 举报

1

主题

71

帖子

304

积分

中级会员

Rank: 3Rank: 3

积分
304
金钱
233
HASS币
0
发表于 2022-5-15 18:23:29 来自手机 | 显示全部楼层
报错误是什么
回复

使用道具 举报

20

主题

700

帖子

3106

积分

论坛元老

Rank: 8Rank: 8

积分
3106
金钱
2406
HASS币
0
发表于 2022-5-10 16:34:13 | 显示全部楼层
现在是不是不能用了?
回复

使用道具 举报

0

主题

26

帖子

239

积分

中级会员

Rank: 3Rank: 3

积分
239
金钱
213
HASS币
0
发表于 2022-5-9 23:36:52 | 显示全部楼层
谢谢分享,最小白的方法没有之一
回复

使用道具 举报

6

主题

267

帖子

2381

积分

论坛技术达人

积分
2381
金钱
2094
HASS币
90
 楼主| 发表于 2022-4-30 00:01:01 | 显示全部楼层

正常,能用!
小米MIoT插件:miot-spec.com
回复

使用道具 举报

22

主题

622

帖子

2813

积分

金牌会员

Rank: 6Rank: 6

积分
2813
金钱
2191
HASS币
0
发表于 2022-4-28 10:22:48 | 显示全部楼层
还能用吗?
回复

使用道具 举报

11

主题

64

帖子

423

积分

中级会员

Rank: 3Rank: 3

积分
423
金钱
359
HASS币
0
发表于 2022-4-28 08:46:02 | 显示全部楼层
必须要支持!!LZNB
回复

使用道具 举报

2

主题

7

帖子

70

积分

注册会员

Rank: 2

积分
70
金钱
63
HASS币
0
发表于 2022-4-13 20:19:29 来自手机 | 显示全部楼层
多谢楼主
回复

使用道具 举报

6

主题

267

帖子

2381

积分

论坛技术达人

积分
2381
金钱
2094
HASS币
90
 楼主| 发表于 2022-4-5 17:14:17 | 显示全部楼层
本帖最后由 anlong 于 2022-4-5 17:15 编辑
wangmucha 发表于 2022-4-5 01:17
Platform error tts.edge_tts - Integration 'edge_tts' not found.

楼主 多次重启ha yaml文件也做了 就是 ...

安装插件后重启HA,再添加yaml配置,然后再重启。
另外再检查日志文件中是否有'edgeTTS'加载失败相关的报错。

小米MIoT插件:miot-spec.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-12-22 17:17 , Processed in 0.072372 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表