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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file ha_remote_tts-0.1.4.tar.gz.

File metadata

  • Download URL: ha_remote_tts-0.1.4.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for ha_remote_tts-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d62e40d4ed89b433b73bf3c3016a00c75ab0e8f1bf92e0f8c673bfade1ef8dbd
MD5 458aa8c5817baf8977654a0ed1b3d3c1
BLAKE2b-256 b5b76369873cb1099ec3d508e3826192c209c968d4570e9ede003321bc9e9411

See more details on using hashes here.

File details

Details for the file ha_remote_tts-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: ha_remote_tts-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for ha_remote_tts-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cd3650f8172ee000167b9423976d2ed0d525879fdaf7accdb281d03f7c698085
MD5 cf0e9912f0ba59a4543823081284dc0e
BLAKE2b-256 d40a97211ba2b9cf5b20c7b4a2169078bc0cbd293487765cc1c309cad6c35517

See more details on using hashes here.

Supported by

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