Skip to content

Commit 220ff1b

Browse files
authored
Initial text-to-speech (TTS) docs (home-assistant#1588)
* Add tts to demo * Add initial TTS docs * Update * Speak->speech * Speak->speech * Speak->speech * Update tts.markdown * Update tts.google.markdown * Update tts.markdown * Update tts.google.markdown * Add files via upload * Create tts.voicerss.markdown * Update tts.voicerss.markdown * Update tts.voicerss.markdown * Update
1 parent c63bfa5 commit 220ff1b

File tree

6 files changed

+155
-0
lines changed

6 files changed

+155
-0
lines changed

source/_components/demo.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Available demo platforms:
2828
- [Remote](/components/remote/) (`remote`)
2929
- [Sensor](/components/sensor/) (`sensor`)
3030
- [Switch](/components/switch/) (`switch`)
31+
- [Text-to-speech](/components/tts/) (`tts`)
3132
- [Weather](/components/weather/) (`weather`)
3233

3334
To integrate a demo platform in Home Assistant, add the following section to your `configuration.yaml` file:
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
layout: page
3+
title: "Google Text-to-Speech"
4+
description: "Instructions how to setup Google Text-to-Speech with Home Assistant."
5+
date: 2016-12-13 07:00
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
logo: google.png
11+
ha_category: Text-to-speech
12+
ha_release: 0.35
13+
---
14+
15+
The `google` text-to-speech platform uses [Google Text-to-Speech engine](https://console.developers.google.com/apis/api/speech.googleapis.com/overview) Text-to-Speech engine to read a text with natural sounding voices.
16+
17+
To enable text-to-speech with Google, add the following lines to your `configuration.yaml`:
18+
19+
```yaml
20+
# Example configuration.yaml entry
21+
tts:
22+
- platform: google
23+
```
24+
25+
Configuration variables:
26+
27+
- **language** (*Optional*): The language to use. Defaults to `en`.
28+
29+
A full configuration sample:
30+
31+
```yaml
32+
# Example configuration.yaml entry
33+
tts:
34+
- platform: google
35+
language: 'de'
36+
```

source/_components/tts.markdown

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
layout: page
3+
title: "Text-to-Speech (TTS)"
4+
description: "Instructions how to setup Text-to-Speech (TTS) with Home Assistant."
5+
date: 2016-12-13 07:00
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
ha_release: 0.35
11+
---
12+
13+
Text-to-speech (TTS) enables Home Assistant to speak to you.
14+
15+
## {% linkable_title Cache %}
16+
17+
The component have two caches. Both caches can be controlled with the `cache` option in the platform configuration or the service call `say`. A long time cache will be located on the file system. The in-memory cache for fast responses to media players will be auto-cleaned after a short period.
18+
19+
## {% linkable_title Configuring a `tts` platform %}
20+
21+
To get started, add the following lines to your `configuration.yaml` (example for google):
22+
23+
```yaml
24+
# Example configuration.yaml entry for google tts service
25+
tts:
26+
- platform: google
27+
```
28+
29+
The following optional parameters can be used with any platform. However the TTS component will only look for global settings under the configuration of the first configured platform:
30+
31+
| Parameter | Default | Description |
32+
|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
33+
| `cache` | True | Allow TTS to cache voice file to local storage. |
34+
| `cache_dir` | tts | Foldername or path to folder for caching files. |
35+
| `time_memory` | 300 | Time to hold the voice data inside memory for fast play on media player. Minimum is 60 s and the maximum 57600 s (16 hours). |
36+
37+
The extended example from above would look like the following sample:
38+
39+
```yaml
40+
# Example configuration.yaml entry for google tts service
41+
tts:
42+
- platform: google
43+
cache: true
44+
cache_dir: /tmp/tts
45+
time_memory: 300
46+
```
47+
48+
## {% linkable_title Service say %}
49+
50+
Say to all `media_player` device entities:
51+
52+
```yaml
53+
service: tts.platform_say
54+
data:
55+
message: 'May the Force be with you.'
56+
```
57+
58+
```yaml
59+
service: tts.platform_say
60+
entity_id: media_player.floor
61+
data:
62+
message: 'May the Force be with you.'
63+
```
64+
65+
With a template:
66+
67+
```yaml
68+
service: tts.platform_say
69+
data_template:
70+
message: 'Temperature is {% raw %}{{ sensor.temperature }}{% endraw %}.'
71+
cache: false
72+
```
73+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
layout: page
3+
title: "VoiceRSS"
4+
description: "Instructions how to setup VoiceRSS TTS with Home Assistant."
5+
date: 2016-12-13 07:00
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
logo: voicerss.png
11+
ha_category: Text-to-speech
12+
ha_release: 0.35
13+
---
14+
15+
The `voicerss` text-to-speech platform uses [VoiceRSS](http://www.voicerss.org/) Text-to-Speech engine to read a text with natural sounding voices.
16+
17+
To enable text-to-speech with VoiceRSS, add the following lines to your `configuration.yaml`:
18+
19+
```yaml
20+
# Example configuration.yaml entry
21+
tts:
22+
- platform: voicerss
23+
api_key: 'XXXXXXXX'
24+
```
25+
26+
Configuration variables:
27+
28+
- **api_key** (*Requered*): API Key for use this service.
29+
- **language** (*Optional*): The language to use. Defaults to `en-us`.
30+
- **codec** (*Optional*): Audo codec. Default is 'mp3'.
31+
- **format** (*Optional*): Audio sample format. Default is '8khz_8bit_mono'
32+
33+
See on api [documentation](http://www.voicerss.org/api/documentation.aspx) for allow values.
34+
35+
A full configuration sample:
36+
37+
```yaml
38+
# Example configuration.yaml entry
39+
tts:
40+
- platform: voicerss
41+
api_key: 'XXXXX'
42+
language: 'de-de'
43+
codec: mp3
44+
format: 8khz_8bit_mono
45+
```
91.4 KB
Loading
80.6 KB
Loading

0 commit comments

Comments
 (0)