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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarmauri_tts_playht-0.11.0.dev4.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

swarmauri_tts_playht-0.11.0.dev4-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file swarmauri_tts_playht-0.11.0.dev4.tar.gz.

File metadata

  • Download URL: swarmauri_tts_playht-0.11.0.dev4.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for swarmauri_tts_playht-0.11.0.dev4.tar.gz
Algorithm Hash digest
SHA256 3a42b43eb9f2e92b1d8030eeceb0965bf60e13fcbb08298af23cb094f97e6a25
MD5 e84646fb9dbc5c60b7a6fff664ec96fe
BLAKE2b-256 33b483e914d8221616edb484b25741d15850cb8798bc1b65b6896db89a2d68c1

See more details on using hashes here.

File details

Details for the file swarmauri_tts_playht-0.11.0.dev4-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_tts_playht-0.11.0.dev4-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for swarmauri_tts_playht-0.11.0.dev4-py3-none-any.whl
Algorithm Hash digest
SHA256 5a203b691bc684179624e74b5a11f38231cec328fbb0e13a5693072619eaac05
MD5 2fcf1b8a0bd745119cce587881cd546d
BLAKE2b-256 5ca5bfe333670829839e447a5523646eb24b79cd60954e2272bbbb482c1ae658

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 Sentry Error logging StatusPage Status page