Skip to main content

Deprecated: Play.ht service discontinued. This package is retained for import compatibility. Construction fails locally with migration instructions. Use swarmauri_standard.tts.OpenaiTTS.OpenaiTTS; install with uv add swarmauri_standard or pip install swarmauri_standard. See the migration guide. The examples below describe the retired service and must not be used for new integrations.

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.1

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.1
File Size Uploaded Provenance Actions
swarmauri_tts_playht-0.11.1.tar.gz 14.1 kB Without provenance Details for swarmauri_tts_playht-0.11.1.tar.gz

Built distribution (wheel)

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

Total release size: 29.5 kB

Release files / swarmauri_tts_playht-0.11.1.tar.gz

Download URL swarmauri_tts_playht-0.11.1.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a15ba2d33b62296e471a86ac2dd0680b54a6d9ba3e44f30e8598430b96949f4d
BLAKE2b-256 checksum
How to use checksums
274701c126c7b1e3db0fd8664f30871e1ee29a0d15095c7b85cdc60924719326
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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.1-py3-none-any.whl

Download URL swarmauri_tts_playht-0.11.1-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e55e6e3bed08e9b3c5dfd8eba6db694c104de9864c4eb18cef570a0e6e38a509
BLAKE2b-256 checksum
How to use checksums
2cef4aec3af8804c9ffce65c08219bbddf9c3552b319935b2ea79519c2c2fc7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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}

Security for swarmauri_tts_playht 0.11.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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