Skip to main content

API wrapper for the Remote TTS integration of Home Assistant

Project description

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

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)

Uploaded Source

Built Distribution

ha_remote_tts-0.1.4-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page