API wrapper for the Remote TTS integration of Home Assistant
Project description
ha-remote-tts
| Package | |
| Meta |
What is it?
API wrapper for the Remote TTS integration of Home Assistant
Usage
API
- POST:
/synthesize- request:
text: The text to synthesize audio for
- response (json):
format: The file format of the generated audioaudio: base64 encoded string of the raw audio
- request:
Server
This is the class end-users should use to serve their own remote TTS engine.
from ha_remote_tts import RemoteTTSServer
import asyncio
def synthesize(text):
audio_bytes = get_tts_audio(text, key)
return audio_bytes, 'wav'
server = RemoteTTSServer(synthesize)
asyncio.run(server.start())
Client
from ha_remote_tts import RemoteTTSClient
import asyncio
client = RemoteTTSClient('http://127.0.0.1:8080')
asyncio.run(client.synthesize('Hello, how are you?'))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ha_remote_tts-0.1.4.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for ha_remote_tts-0.1.4-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | cd3650f8172ee000167b9423976d2ed0d525879fdaf7accdb281d03f7c698085 |
|
| MD5 | cf0e9912f0ba59a4543823081284dc0e |
|
| BLAKE2b-256 | d40a97211ba2b9cf5b20c7b4a2169078bc0cbd293487765cc1c309cad6c35517 |