Skip to content

WIP API Wrapper for Home Assistant RemoteTTS integration

License

Notifications You must be signed in to change notification settings

NicolasNewman/ha-remote-tts

Repository files navigation

ha-remote-tts

Package PyPI Latest Release PyPI Downloads
Meta License - MIT

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 audio
      • audio: base64 encoded string of the raw audio

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?'))

Demos

See examples/ for real world demos.

About

WIP API Wrapper for Home Assistant RemoteTTS integration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages