本帖最后由 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%
|