Namespaces | |
| const | |
| helper | |
| legacy | |
| media_source | |
| models | |
| notify | |
Classes | |
| class | SpeechManager |
| class | TextToSpeechEntity |
| class | TextToSpeechUrlView |
| class | TextToSpeechView |
| class | TTSCache |
Functions | |
| bytes | _convert_audio (str ffmpeg_binary, str from_extension, bytes audio_bytes, str to_extension, int|None to_sample_rate=None, int|None to_sample_channels=None, int|None to_sample_bytes=None) |
| dict[str, str] | _get_cache_files (str cache_dir) |
| str | _hash_options (dict options) |
| str | _init_tts_cache_dir (HomeAssistant hass, str cache_dir) |
| bytes | async_convert_audio (HomeAssistant hass, str from_extension, bytes audio_bytes, str to_extension, int|None to_sample_rate=None, int|None to_sample_channels=None, int|None to_sample_bytes=None) |
| str|None | async_default_engine (HomeAssistant hass) |
| tuple[str, bytes] | async_get_media_source_audio (HomeAssistant hass, str media_source_id) |
| set[str] | async_get_text_to_speech_languages (HomeAssistant hass) |
| str|None | async_resolve_engine (HomeAssistant hass, str|None engine) |
| bool | async_setup (HomeAssistant hass, ConfigType config) |
| bool | async_setup_entry (HomeAssistant hass, ConfigEntry entry) |
| bool | async_support_options (HomeAssistant hass, str engine, str|None language=None, dict|None options=None) |
| bool | async_unload_entry (HomeAssistant hass, ConfigEntry entry) |
| None | websocket_get_engine (HomeAssistant hass, websocket_api.ActiveConnection connection, dict msg) |
| None | websocket_list_engine_voices (HomeAssistant hass, websocket_api.ActiveConnection connection, dict msg) |
| None | websocket_list_engines (HomeAssistant hass, websocket_api.ActiveConnection connection, dict msg) |
Variables | |
| list | __all__ |
| string | _DEFAULT_FORMAT = "mp3" |
| _LOGGER = logging.getLogger(__name__) | |
| _RE_LEGACY_VOICE_FILE | |
| _RE_VOICE_FILE | |
| string | ATTR_AUDIO_OUTPUT = "audio_output" |
| string | ATTR_MEDIA_PLAYER_ENTITY_ID = "media_player_entity_id" |
| string | ATTR_PLATFORM = "platform" |
| string | ATTR_PREFERRED_FORMAT = "preferred_format" |
| string | ATTR_PREFERRED_SAMPLE_BYTES = "preferred_sample_bytes" |
| string | ATTR_PREFERRED_SAMPLE_CHANNELS = "preferred_sample_channels" |
| string | ATTR_PREFERRED_SAMPLE_RATE = "preferred_sample_rate" |
| string | ATTR_VOICE = "voice" |
| dictionary | CACHED_PROPERTIES_WITH_ATTR_ |
| string | CONF_LANG = "language" |
| string | KEY_PATTERN = "{0}_{1}_{2}_{3}" |
| SCHEMA_SERVICE_CLEAR_CACHE = vol.Schema({}) | |
| string | SERVICE_CLEAR_CACHE = "clear_cache" |
Provide functionality for TTS.
|
private |
Convert audio to a preferred format using ffmpeg.
Definition at line 240 of file __init__.py.
|
private |
Return a dict of given engine files.
Definition at line 1022 of file __init__.py.
|
private |
Hashes an options dictionary.
Definition at line 514 of file __init__.py.
|
private |
Init cache folder.
Definition at line 1012 of file __init__.py.
| bytes homeassistant.components.tts.async_convert_audio | ( | HomeAssistant | hass, |
| str | from_extension, | ||
| bytes | audio_bytes, | ||
| str | to_extension, | ||
| int | None | to_sample_rate = None, |
||
| int | None | to_sample_channels = None, |
||
| int | None | to_sample_bytes = None |
||
| ) |
Convert audio to a preferred format using ffmpeg.
Definition at line 216 of file __init__.py.
| str | None homeassistant.components.tts.async_default_engine | ( | HomeAssistant | hass | ) |
Return the domain or entity id of the default engine. Returns None if no engines found.
Definition at line 138 of file __init__.py.
| tuple[str, bytes] homeassistant.components.tts.async_get_media_source_audio | ( | HomeAssistant | hass, |
| str | media_source_id | ||
| ) |
Get TTS audio as extension, data.
Definition at line 190 of file __init__.py.
| set[str] homeassistant.components.tts.async_get_text_to_speech_languages | ( | HomeAssistant | hass | ) |
Return a set with the union of languages supported by tts engines.
Definition at line 201 of file __init__.py.
| str | None homeassistant.components.tts.async_resolve_engine | ( | HomeAssistant | hass, |
| str | None | engine | ||
| ) |
Resolve engine. Returns None if no engines found or invalid engine passed in.
Definition at line 156 of file __init__.py.
| bool homeassistant.components.tts.async_setup | ( | HomeAssistant | hass, |
| ConfigType | config | ||
| ) |
Set up TTS.
Definition at line 301 of file __init__.py.
| bool homeassistant.components.tts.async_setup_entry | ( | HomeAssistant | hass, |
| ConfigEntry | entry | ||
| ) |
Set up a config entry.
Definition at line 368 of file __init__.py.
| bool homeassistant.components.tts.async_support_options | ( | HomeAssistant | hass, |
| str | engine, | ||
| str | None | language = None, |
||
| dict | None | options = None |
||
| ) |
Return if an engine supports options.
Definition at line 172 of file __init__.py.
| bool homeassistant.components.tts.async_unload_entry | ( | HomeAssistant | hass, |
| ConfigEntry | entry | ||
| ) |
Unload a config entry.
Definition at line 373 of file __init__.py.
| None homeassistant.components.tts.websocket_get_engine | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict | msg | ||
| ) |
Get text to speech engine info.
Definition at line 1163 of file __init__.py.
| None homeassistant.components.tts.websocket_list_engine_voices | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict | msg | ||
| ) |
List voices for a given language.
Definition at line 1209 of file __init__.py.
| None homeassistant.components.tts.websocket_list_engines | ( | HomeAssistant | hass, |
| websocket_api.ActiveConnection | connection, | ||
| dict | msg | ||
| ) |
List text to speech engines and, optionally, if they support a given language.
Definition at line 1115 of file __init__.py.
|
private |
Definition at line 75 of file __init__.py.
|
private |
Definition at line 106 of file __init__.py.
|
private |
Definition at line 95 of file __init__.py.
|
private |
Definition at line 118 of file __init__.py.
|
private |
Definition at line 121 of file __init__.py.
| string homeassistant.components.tts.ATTR_AUDIO_OUTPUT = "audio_output" |
Definition at line 98 of file __init__.py.
| string homeassistant.components.tts.ATTR_MEDIA_PLAYER_ENTITY_ID = "media_player_entity_id" |
Definition at line 103 of file __init__.py.
| string homeassistant.components.tts.ATTR_PLATFORM = "platform" |
Definition at line 97 of file __init__.py.
| string homeassistant.components.tts.ATTR_PREFERRED_FORMAT = "preferred_format" |
Definition at line 99 of file __init__.py.
| string homeassistant.components.tts.ATTR_PREFERRED_SAMPLE_BYTES = "preferred_sample_bytes" |
Definition at line 102 of file __init__.py.
| string homeassistant.components.tts.ATTR_PREFERRED_SAMPLE_CHANNELS = "preferred_sample_channels" |
Definition at line 101 of file __init__.py.
| string homeassistant.components.tts.ATTR_PREFERRED_SAMPLE_RATE = "preferred_sample_rate" |
Definition at line 100 of file __init__.py.
| string homeassistant.components.tts.ATTR_VOICE = "voice" |
Definition at line 104 of file __init__.py.
| dictionary homeassistant.components.tts.CACHED_PROPERTIES_WITH_ATTR_ |
Definition at line 378 of file __init__.py.
| string homeassistant.components.tts.CONF_LANG = "language" |
Definition at line 114 of file __init__.py.
| string homeassistant.components.tts.KEY_PATTERN = "{0}_{1}_{2}_{3}" |
Definition at line 124 of file __init__.py.
| homeassistant.components.tts.SCHEMA_SERVICE_CLEAR_CACHE = vol.Schema({}) |
Definition at line 126 of file __init__.py.
| string homeassistant.components.tts.SERVICE_CLEAR_CACHE = "clear_cache" |
Definition at line 116 of file __init__.py.