Skip to main content

Getting Started

Setup Environment​

  1. Clone the ts-client repository if you haven't already. This repository contains both the TTS (text-to-speech) and STT (speech-to-text) clients.
git clone https://github.com/Talkscriber/ts-client.git
cd ts-client/tts
  1. Create and Activate the Conda Environment:

    • Open your terminal.
    • Create a new Conda environment with Python 3.9:
      conda create --name talkscriber python=3.9
    • Activate the newly created environment:
      conda activate talkscriber
  2. Install Required Packages:

    • Ensure you are in the project directory where requirements.txt is located.
    • Install the necessary Python packages using pip:
      pip install -r requirements.txt

PyAudio Installation Notes:

  • macOS: brew install portaudio then pip install pyaudio
  • Ubuntu/Debian: sudo apt-get install libasound2-dev portaudio19-dev then pip install pyaudio
  • Windows: pip install pyaudio (should work directly)

Now that you have the dependencies installed, let's get you started with a quick example to verify everything works.

Note: If you don't have an API key yet, see the Quick Start Guide for instructions on how to obtain your API key from the Talkscriber dashboard.

Quick Start​

Ready to get started? Here's the simplest way to use the TalkScriber TTS client:

from client.tts_client import TalkScriberTTSClient

# Basic usage
client = TalkScriberTTSClient(
api_key="your_api_key_here",
text="Hello, this is a test message.",
speaker_name="tara"
)
success = client.run_simple_test()

What to expect: This example will connect to the TalkScriber TTS server, send a text message, and receive ultra-low latency audio streaming. You'll hear speech start in less than 0.1 seconds, with audio playing immediately as it's generated from the server.