| Package | |
| Meta |
API wrapper for the Remote TTS integration of Home Assistant
- 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:
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())from ha_remote_tts import RemoteTTSClient
import asyncio
client = RemoteTTSClient('http://127.0.0.1:8080')
asyncio.run(client.synthesize('Hello, how are you?'))See examples/ for real world demos.