Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Swarmauri Logo

Swarmauri PlayHT Text-to-Speech

swarmauri_tts_playht is the standalone PlayHT provider package for Swarmauri. Its PlayHTModel implements TTSBase and converts independent text inputs into audio files without pretending to be an LLM.

PyPI Downloads Hits Python Versions License PyPI Version

Features

  • Native TTSBase provider registered as swarmauri.tts.PlayHTModel.
  • Synchronous, asynchronous, and batch audio generation.
  • PlayHT voice discovery and cloned-voice management.
  • Configurable voice engine, voice, output format, and timeout.
  • Agent-only CLI support for positional, piped, file-based, and interactive text.
  • Command-line selection of the PlayHT voice model and voice.

Installation

uv add swarmauri_tts_playht
pip install swarmauri_tts_playht

Set PLAYHT_API_KEY and PLAYHT_USER_ID before generating audio.

Usage

import os

from swarmauri_tts_playht import PlayHTModel

tts = PlayHTModel(
    api_key=os.environ["PLAYHT_API_KEY"],
    user_id=os.environ["PLAYHT_USER_ID"],
    name="Play3.0-mini",
    voice="Adolfo",
)
audio_path = tts.predict("Welcome to Swarmauri.", "welcome.mp3")
print(audio_path)

Generate through the stateless TextToSpeechAgent:

swarmauri-playht "Welcome to Swarmauri." \
  --voice-model PlayHT2.0-turbo \
  --voice Adolfo \
  --output welcome.mp3

Every CLI invocation uses TextToSpeechAgent. It adds no conversation, memory, system context, or text-generating LLM. --model remains available as an alias for --voice-model.

The supported command-line voice engines are Play3.0-mini, PlayHT2.0-turbo, PlayHT1.0, and PlayHT2.0. Text can also come from a UTF-8 file or standard input:

swarmauri-playht --prompt-file announcement.txt --output announcement.mp3
echo "Welcome to Swarmauri." | swarmauri-playht --output welcome.mp3

Use the same stateless workflow from Python:

import os

from swarmauri_agent_texttospeech import TextToSpeechAgent
from swarmauri_tts_playht import PlayHTModel

tts = PlayHTModel(
    api_key=os.environ["PLAYHT_API_KEY"],
    user_id=os.environ["PLAYHT_USER_ID"],
    name="PlayHT2.0-turbo",
    voice="Adolfo",
)
agent = TextToSpeechAgent(tts=tts, output_path="welcome.mp3")
audio_path = agent.exec("Welcome to Swarmauri.")

Contributing

This package is part of the Swarmauri SDK. Contributions should follow the repository contribution and style guides.

License

Apache-2.0

Metadata

Release files for swarmauri_tts_playht 0.11.0.dev4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swarmauri_tts_playht 0.11.0.dev4
File Size Uploaded
swarmauri_tts_playht-0.11.0.dev4.tar.gz 13.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for swarmauri_tts_playht 0.11.0.dev4
File Interpreter ABI Platform
swarmauri_tts_playht-0.11.0.dev4-py3-none-any.whl Python 3 none any Details

Total release size: 27.4 kB

Release files / swarmauri_tts_playht-0.11.0.dev4.tar.gz

Download URL swarmauri_tts_playht-0.11.0.dev4.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3a42b43eb9f2e92b1d8030eeceb0965bf60e13fcbb08298af23cb094f97e6a25
BLAKE2b-256 checksum
How to use checksums
33b483e914d8221616edb484b25741d15850cb8798bc1b65b6896db89a2d68c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / swarmauri_tts_playht-0.11.0.dev4-py3-none-any.whl

Download URL swarmauri_tts_playht-0.11.0.dev4-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a203b691bc684179624e74b5a11f38231cec328fbb0e13a5693072619eaac05
BLAKE2b-256 checksum
How to use checksums
5ca5bfe333670829839e447a5523646eb24b79cd60954e2272bbbb482c1ae658
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.11.0.dev4 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page