anlong 发表于 2021-9-28 14:45:24

基于Edge浏览器的微软TTS插件,无需app_key

本帖最后由 anlong 于 2022-2-21 19:04 编辑

插件地址:https://github.com/hasscc/hass-edge-tts

本插件基于Edge浏览器的TTS服务,无需在微软Azure申请app_key等。且可指定声音、语气、角色、银两、语速等选项。

安装:
下载并复制`custom_components/edge_tts`文件夹到HomeAssistant根目录下的`custom_components`文件夹,也可通过下面的shell命令安装:
wget -q -O - https://cdn.jsdelivr.net/gh/al-one/hass-xiaomi-miot/install.sh | DOMAIN=edge_tts REPO_PATH=hasscc/hass-edge-tts ARCHIVE_TAG=main bash -
配置:
# configuration.yaml
tts:
- platform: edge_tts
    language: zh-CN # 默认语言或声音(可选)
支持的语言:
- zh-CN
- zh-CN-XiaoxiaoNeural
- zh-CN-YunyangNeural
- zh-CN-YunyeNeural
- zh-CN-YunxiNeural
- zh-CN-XiaohanNeural
- zh-CN-XiaomoNeural
- zh-CN-XiaoxuanNeural
- zh-CN-XiaoruiNeural
- zh-HK
- zh-HK-HiuMaanNeural
- zh-TW
- zh-TW-HsiaoChenNeural
[*]更多语言
[*]更多声音

选项:

[*]voice: 声音
[*]style: 语气
[*]styledegree: 语气强度,范围:0.01 - 2,仅普通话可用
[*]role: 角色,仅`zh-CN-XiaomoNeural`和`zh-CN-XiaoxuanNeural`可用
[*]调整韵律(`pitch`、`rate`、`volume`)



基础使用示例:
以下代码不是写到配置文件中,可以在[开发者工具] -> [服务]中来执行,也可以在自动化、脚本、自定义卡片中调用。
service: tts.edge_tts_say
data:
entity_id: media_player.your_player_entity_id
message: 你好
language: zh-CN-XiaoxiaoNeural # 语言或声音(可选)
完整使用示例:
service: tts.edge_tts_say
data:
entity_id: media_player.your_player_entity_id
message: 吃葡萄不吐葡萄皮,不吃葡萄倒吐葡萄皮
language: zh-CN
cache: true
options:
    voice: zh-CN-XiaomoNeural
    style: cheerful
    styledegree: 2
    role: Girl
    pitch: +0Hz
    rate: +0%
    volume: +10%

XCray 发表于 2021-9-28 14:57:41

这是迄今为止HA上效果最好、使用最方便的TTS组件!

本帖最后由 XCray 于 2021-9-28 17:52 编辑

好!楼主给力!

fulinsky 发表于 2024-2-29 11:22:41

2024.02.29亲测可用,楼主威武,期待更多优秀经验分享!

vico 发表于 2024-1-6 00:17:05

huyifanstar 发表于 2023-6-5 18:13
支持homepod吗?

亲测支持

zhengxujin 发表于 2023-12-12 12:50:48

Call-service error. required key not provided @ data['message']

nr的msg.playload推送不了,请教下怎么弄,ha调用服务是可以成功的

szl006dl 发表于 2023-11-18 12:38:18

感谢分享,已经成功启用,稳定性待测试。

893213 发表于 2023-11-1 17:56:36

学习一下

cxz7411 发表于 2023-7-22 08:02:02

现在调用服务成功,但是没有声音了

huyifanstar 发表于 2023-6-5 18:13:15

支持homepod吗?

mr_chenxc 发表于 2023-4-21 12:19:09

laogong888 发表于 2023-1-23 17:13
已经不能用了么!配置无效

2023-4-18 按照大神上面方法安装。依旧有效。已安装成功使用

mzlshizhu 发表于 2023-4-9 20:28:59

龙佬,现在这个TTS时好时坏的,有啥解决办法吗
页: [1] 2 3 4 5 6 7 8 9 10
查看完整版本: 基于Edge浏览器的微软TTS插件,无需app_key