Skip to main content

A Python client library for the Aristech Text-to-Speech API

Project description

Aristech TTS-Client for Python

This is the Python client implementation for the Aristech TTS-Server.

Installation

pip install aristech-tts-client

Usage

from aristech_tts_client import TtsClient, SpeechRequest, SpeechRequestOption

client = TtsClient(host='tts.example.com')
data = client.synthesize(SpeechRequest(
    text='Hello, world!',
    options=SpeechRequestOption(
      voice_id='some-voice-id'
    )
))
with open('output.wav', 'wb') as f:
    f.write(data)

There are several examples in the examples directory:

  • file.py: Pretty much the same as the example above.
  • streaming.py: Demonstrates how to stream audio to a sox process which plays the audio as it is being streamed.
  • voices.py: Demonstrates how to get the available voices from the server.
  • phoneset.py: Demonstrates how to get the phoneset for a voice.
  • transcribe.py: Demonstrates how to get how a voice would pronounce a given word.

You can run the examples directly using python like this:

  1. Create a .env file in the python directory:
HOST=tts.example.com
# The credentials are optional but probably required for most servers:
TOKEN=your-token
SECRET=your-secret

# The following are optional:
# ROOT_CERT=your-root-cert.pem # If the server uses a self-signed certificate
# VOICE_ID=some-available-voice-id
  1. Run the examples, e.g.:
python examples/streaming.py

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

aristech_tts_client-1.0.1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

aristech_tts_client-1.0.1-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file aristech_tts_client-1.0.1.tar.gz.

File metadata

  • Download URL: aristech_tts_client-1.0.1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for aristech_tts_client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2c7dbed32ffbb02a231983fff593ec4d53ec0041812b28d34dd0012f25d3b3d4
MD5 5ed4a2e1b4696c7a469b9580977e4e27
BLAKE2b-256 27d6f7bfeb97fa892579fb872545b77873d62e3c2251bc1c78a2036d3c46380c

See more details on using hashes here.

File details

Details for the file aristech_tts_client-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aristech_tts_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1b6d0e35fea870f23f0f0a32acdc43764e26b4f6757d63404ae8225de29c17e3
MD5 15c4728c73d8a8d1ed7f6ed0b0b405b5
BLAKE2b-256 734d39a0453c13829484d42fbfa6a8ee63d4f17f1781fe5967f8371addfc6665

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