# ha-remote-tts
| | |
| ------- | - |
| Package | [](https://pypi.org/project/ha-remote-tts/) [](https://pypi.org/project/ha-remote-tts/) |
| Meta | [](https://github.com/NicolasNewman/ha-remote-tts/blob/main/LICENSE) |
## 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.
```python
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
```python
from ha_remote_tts import RemoteTTSClient
import asyncio
client = RemoteTTSClient('http://127.0.0.1:8080')
asyncio.run(client.synthesize('Hello, how are you?'))
```
Raw data
{
"_id": null,
"home_page": "https://github.com/NicolasNewman/ha-remote-tts",
"name": "ha-remote-tts",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "NicolasNewman",
"author_email": "nanewman01@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b5/b7/6369873cb1099ec3d508e3826192c209c968d4570e9ede003321bc9e9411/ha_remote_tts-0.1.4.tar.gz",
"platform": null,
"description": "# ha-remote-tts\n\n| | |\n| ------- | - |\n| Package | [](https://pypi.org/project/ha-remote-tts/) [](https://pypi.org/project/ha-remote-tts/) |\n| Meta | [](https://github.com/NicolasNewman/ha-remote-tts/blob/main/LICENSE) |\n\n## What is it?\n\nAPI wrapper for the Remote TTS integration of Home Assistant\n\n## Usage\n\n### API\n\n- POST: `/synthesize`\n - request:\n - `text`: The text to synthesize audio for\n - response (json):\n - `format`: The file format of the generated audio\n - `audio`: base64 encoded string of the raw audio\n\n### Server\n\nThis is the class end-users should use to serve their own remote TTS engine.\n\n```python\nfrom ha_remote_tts import RemoteTTSServer\nimport asyncio\n\ndef synthesize(text):\n\n audio_bytes = get_tts_audio(text, key)\n\n return audio_bytes, 'wav'\n\nserver = RemoteTTSServer(synthesize)\nasyncio.run(server.start())\n```\n\n### Client\n\n```python\nfrom ha_remote_tts import RemoteTTSClient\nimport asyncio\n\nclient = RemoteTTSClient('http://127.0.0.1:8080')\nasyncio.run(client.synthesize('Hello, how are you?'))\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "API wrapper for the Remote TTS integration of Home Assistant",
"version": "0.1.4",
"project_urls": {
"Homepage": "https://github.com/NicolasNewman/ha-remote-tts",
"Repository": "https://github.com/NicolasNewman/ha-remote-tts"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d40a97211ba2b9cf5b20c7b4a2169078bc0cbd293487765cc1c309cad6c35517",
"md5": "cf0e9912f0ba59a4543823081284dc0e",
"sha256": "cd3650f8172ee000167b9423976d2ed0d525879fdaf7accdb281d03f7c698085"
},
"downloads": -1,
"filename": "ha_remote_tts-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cf0e9912f0ba59a4543823081284dc0e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 4331,
"upload_time": "2024-08-25T20:52:06",
"upload_time_iso_8601": "2024-08-25T20:52:06.239743Z",
"url": "https://files.pythonhosted.org/packages/d4/0a/97211ba2b9cf5b20c7b4a2169078bc0cbd293487765cc1c309cad6c35517/ha_remote_tts-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b5b76369873cb1099ec3d508e3826192c209c968d4570e9ede003321bc9e9411",
"md5": "458aa8c5817baf8977654a0ed1b3d3c1",
"sha256": "d62e40d4ed89b433b73bf3c3016a00c75ab0e8f1bf92e0f8c673bfade1ef8dbd"
},
"downloads": -1,
"filename": "ha_remote_tts-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "458aa8c5817baf8977654a0ed1b3d3c1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 3550,
"upload_time": "2024-08-25T20:52:07",
"upload_time_iso_8601": "2024-08-25T20:52:07.446643Z",
"url": "https://files.pythonhosted.org/packages/b5/b7/6369873cb1099ec3d508e3826192c209c968d4570e9ede003321bc9e9411/ha_remote_tts-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-25 20:52:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "NicolasNewman",
"github_project": "ha-remote-tts",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "ha-remote-tts"
}