Typecast is an AI text-to-speech API that converts text into lifelike, expressive speech in many languages.
Project description
Pipecat Typecast TTS Integration
Add high-quality neural voices from Typecast to your Pipecat AI pipelines.
Maintainer: Neosapience / Typecast team (@neosapience)
Installation
pip install pipecat-ai-typecast
Prerequisites
- Typecast API key (
TYPECAST_API_KEY) - Optional: Voice override (
TYPECAST_VOICE_ID) – defaults totc_62a8975e695ad26f7fb514d1
Usage with Pipecat Pipeline
TypecastTTSService integrates Typecast's streaming text-to-speech into a Pipecat pipeline. It converts LLM text output into expressive speech while leveraging Pipecat's transport, STT, and turn-taking stack.
import os, aiohttp
from pipecat.pipeline.pipeline import Pipeline
from pipecat_typecast.tts import TypecastTTSService
async with aiohttp.ClientSession() as session:
llm = ...
sst = ...
tts = TypecastTTSService(
aiohttp_session=session,
api_key=os.getenv("TYPECAST_API_KEY"),
voice_id=os.getenv("TYPECAST_VOICE_ID", "tc_62a8975e695ad26f7fb514d1"),
)
pipeline = Pipeline([
transport.input(), # audio/user input
stt, # speech to text
context_aggregator.user(), # add user text to context
llm, # LLM generates response
tts, # Typecast TTS synthesis
transport.output(), # stream audio back to user
context_aggregator.assistant(), # store assistant response
])
See example.py for a complete working example including event handlers and transport setup.
Advanced Configuration (Emotion & Audio Controls)
TypecastTTSService exposes structured parameter models so you can tune emotion and audio output.
from pipecat_typecast.tts import (
TypecastTTSService,
TypecastInputParams,
PromptOptions,
OutputOptions,
)
params = TypecastInputParams(
# Language influences pronunciation model (defaults to English)
# Language.EN / Language.KO / Language.JA ...
# If omitted, Typecast auto-detect may apply (depending on voice).
prompt_options=PromptOptions(
emotion_preset="happy", # normal | happy | sad | angry | whisper (voice dependent)
emotion_intensity=1.3, # 0.0–2.0 (float)
),
output_options=OutputOptions(
volume=110, # 0–200 (percent)
audio_pitch=2, # -12..12 (semitones)
audio_tempo=1.05, # 0.5–2.0 (playback speed)
audio_format="wav", # Only 'wav' currently supported
),
)
tts = TypecastTTSService(
aiohttp_session=session,
api_key=os.getenv("TYPECAST_API_KEY"),
voice_id="tc_62a8975e695ad26f7fb514d1", # Replace with another voice ID as desired
model="ssfm-v21", # Default model
params=params,
)
Notes:
emotion_presetavailability varies by voice. If unsupported, the service falls back to neutral.emotion_intensity> 1.0 increases expressiveness; extreme values can sound synthetic.audio_pitchshifts pitch in musical semitone units (use small adjustments for naturalness).audio_tempochanges speaking speed; keep within 0.85–1.15 for intelligibility.seed(set inTypecastInputParams) provides deterministic synthesis for identical text (when supported by model).- Unsupported
audio_formatvalues yield an error frame—keepwav.
Running the Example
-
Install dependencies:
uv sync -
Set up your environment
cp env.example .env
-
Run:
uv run python example.py
The bot will create a call (e.g. Daily room) and speak responses using Typecast voices.
Compatibility
Tested with Pipecat v0.0.89
- Python 3.10+
- Daily / Twilio / generic WebRTC transports (see
example.py)
License
BSD-2-Clause - see LICENSE
Support
- Docs: https://typecast.ai (refer to API docs for voice IDs & parameters)
- Pipecat Discord: https://discord.gg/pipecat (
#community-integrations)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pipecat_ai_typecast-0.0.1.tar.gz.
File metadata
- Download URL: pipecat_ai_typecast-0.0.1.tar.gz
- Upload date:
- Size: 267.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab5ccdc94c3c352a3a7cc0d5c3497f98cbf90be24b85b5832f6471cb9e201330
|
|
| MD5 |
57153148ffdc3d87ef24a4e09a2dd504
|
|
| BLAKE2b-256 |
549d86eb6d698ade95b0f7bee665a16c84333eb8e83bd027f4726e5305f165a4
|
File details
Details for the file pipecat_ai_typecast-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pipecat_ai_typecast-0.0.1-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9c51a654babb81b81a0d106da6ea365b6fc02835d1de61ea90a56b8a2c71815
|
|
| MD5 |
ad01e7f064f40f19840b963a6fcd6879
|
|
| BLAKE2b-256 |
161955ff2ce916d46f3be640c11aceab22c5c218e4566c8be16034dde8167361
|