Skip to main content

OneLab TTS Library

OneLab is a powerful Python library for Text-to-Speech (TTS) and Podcast generation, built on top of ChatterboxTurboTTS. It allows you to easily convert text to speech using various voices and create multi-speaker podcasts with custom logging and progress tracking.

Features

  • Text-to-Speech Conversion: Convert individual text segments to audio using specific voices.
  • Podcast Generation: Create full conversations with multiple speakers.
  • Dynamic Voice Loading: Automatically detects available voices from the package's sample directory.
  • Custom Logging: Detailed logging and progress tracking during generation.
  • Modular Design: Clean and extensible architecture.

Installation

You can install the package using pip:

pip install onelab

Or install directly from the source:

git clone https://github.com/satadeep3927/onelab.git
cd onelab
pip install .

Usage

Initialization

To use the library, simply initialize the OneLab class. The library automatically locates the bundled voice samples.

from onelab import OneLab

# Initialize OneLab
onelab = OneLab(device="cpu") 

Listing Available Voices

You can list all voices detected in the sample directory:

voices = onelab.tts.list_voices()
print("Available voices:", voices)

Converting Text to Speech

To convert a single line of text:

wav = onelab.tts.convert("Hello, world!", voice="charlie")
# Save the output
import torchaudio
torchaudio.save("output.wav", wav, onelab.tts.model.sr)

Creating a Podcast

To create a multi-speaker podcast, define your conversation segments and use the podcast.create method:

from onelab import ConversationInput

data: ConversationInput = {
    "segments": [
        {"voice": "charlie", "text": "Hello Emilia!"},
        {"voice": "emilia", "text": "Hi Charlie! How are you?"},
    ]
}

# Generate the podcast
podcast_wav = onelab.tts.podcast.create(data)

# Save the podcast
torchaudio.save("podcast.wav", podcast_wav, onelab.tts.model.sr)

API Reference

OneLab

The main entry point for the library.

  • __init__(device: str = "cpu"): Initializes the library.

TextToSpeech (accessed via onelab.tts)

Handles TTS operations.

  • list_voices() -> List[str]: Returns a list of available voice names.
  • convert(text: str, voice: str) -> torch.Tensor: Generates audio for the given text and voice.

Podcast (accessed via onelab.tts.podcast)

Handles podcast generation.

  • create(args: ConversationInput) -> torch.Tensor: Generates a concatenated audio waveform for the entire conversation.

License

MIT

Metadata

Release files for onelab-tts 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onelab-tts 1.0.0
File Size Uploaded
onelab_tts-1.0.0.tar.gz 32.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for onelab-tts 1.0.0
File Interpreter ABI Platform
onelab_tts-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 64.4 MB

Release files / onelab_tts-1.0.0.tar.gz

Download URL onelab_tts-1.0.0.tar.gz
Size 32.2 MB
Tags Source
SHA-256 checksum
How to use checksums
1b53b3ea57cc7797c4bdb9e46ac8bb2a4ec16ffd633918a2f4b68c0e933f78f5
BLAKE2b-256 checksum
How to use checksums
4f602940fec5a7b71b1b984b8092f7ce4d3a023a9b45e020eed7d96d5bf9d625
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / onelab_tts-1.0.0-py3-none-any.whl

Download URL onelab_tts-1.0.0-py3-none-any.whl
Size 32.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b7cf83be652f48b07629c803b5fe086f55f1405b974efa370263acb26471069b
BLAKE2b-256 checksum
How to use checksums
24275ffc22e0df34935b03ea32b21de18fcf367a92abf0b02be95cbc168dd9f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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