Skip to content

Commit

Permalink
🛠️ remove style/styledegree/role options (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Jun 20, 2022
1 parent 2c1c830 commit f90610f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
24 changes: 4 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ tts:
```yaml
tts:
- platform: edge_tts
service_name: xiaomo_say
service_name: xiaomo_say # service: tts.xiaomo_say
language: zh-CN-XiaomoNeural
style: cheerful
styledegree: 2
role: Girl
volume: 100.0
```
Expand All @@ -51,20 +48,10 @@ tts:
### Options
- [`voice`](https://docs.microsoft.com/zh-CN/azure/cognitive-services/speech-service/speech-synthesis-markup?tabs=csharp#use-multiple-voices)
- [`style`](https://docs.microsoft.com/zh-CN/azure/cognitive-services/speech-service/speech-synthesis-markup?tabs=csharp#adjust-speaking-styles)
- [Voice styles and roles](https://docs.microsoft.com/zh-CN/azure/cognitive-services/speech-service/language-support?tabs=speechtotext#voice-styles-and-roles)
- [`styledegree`](https://docs.microsoft.com/zh-CN/azure/cognitive-services/speech-service/speech-synthesis-markup?tabs=csharp#style-degree): 0.01 - 2, only for `zh-CN`
- [`role`](https://docs.microsoft.com/zh-CN/azure/cognitive-services/speech-service/speech-synthesis-markup?tabs=csharp#role): only for `zh-CN-XiaomoNeural` / `zh-CN-XiaoxuanNeural` / `zh-CN-YunxiNeural` / `zh-CN-YunyeNeural`
- Girl
- Boy
- YoungAdultFemale
- YoungAdultMale
- OlderAdultFemale
- OlderAdultMale
- SeniorFemale
- SeniorMale
- [`pitch` / `rate` / `volume` / `contour`](https://docs.microsoft.com/zh-CN/azure/cognitive-services/speech-service/speech-synthesis-markup?tabs=csharp#adjust-prosody)

> `style` / `styledegree` / `role` are no longer supported ([#8](https://github.com/hasscc/hass-edge-tts/issues/8)).

### Basic example

```yaml
Expand All @@ -87,9 +74,6 @@ data:
cache: true
options:
voice: zh-CN-XiaomoNeural
style: cheerful
styledegree: 2
role: Girl
pitch: +0Hz
rate: +0%
volume: +10%
Expand All @@ -102,7 +86,7 @@ data:
```shell
curl -X POST -H "Authorization: Bearer <ACCESS TOKEN>" \
-H "Content-Type: application/json" \
-d '{"platform": "edge_tts", "message": "欢迎回家", "language": "zh-CN-XiaoxuanNeural", "cache": false, "options": {"style": "cheerful", "role": "Boy"}}' \
-d '{"platform": "edge_tts", "message": "欢迎回家", "language": "zh-CN-XiaoxuanNeural", "cache": true, "options": {"volume": "+10%"}}' \
http://home-assistant.local:8123/api/tts_get_url
```

Expand Down
4 changes: 2 additions & 2 deletions custom_components/edge_tts/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@


async def async_get_engine(hass, config, discovery_info=None):
""""Set up the component."""
"""Set up the component."""
return SpeechProvider(hass, config)


Expand All @@ -121,7 +121,7 @@ def __init__(self, hass, config):
self.name = 'Edge TTS'
self.hass = hass
self._config = config or {}
self._style_options = ['style', 'styledegree', 'role']
self._style_options = [] # 'style', 'styledegree', 'role' # issues/8
self._prosody_options = ['pitch', 'contour', 'range', 'rate', 'duration', 'volume']

@property
Expand Down

0 comments on commit f90610f

Please sign in to comment.