Skip to main content

Simplifies arranging text fragments with multiple speakers and processing it with coqui.ai TTS

Project description

TTS Arranger

A library that simplifies arranging text items fragments with multiple speakers and processing them using coqui.ai TTS to write audio files.

Examples

from tts_arranger import (TTS_Chapter, TTS_Item, TTS_Project,
                          TTS_Simple_Writer, TTS_Writer)

# Simple example using Simple Writer (using a simple list of TTS items)

tts_items = []

tts_items.append(TTS_Item('This is a test', 'p330'))
tts_items.append(TTS_Item('This is a test with another speaker and a fixed minimum length', 'p273', length=10000))
tts_items.append(TTS_Item(length=2000))  # Insert pause

simple_writer = TTS_Simple_Writer(tts_items)
simple_writer.synthesize_and_write('/tmp/tts_arranger_example_output/test.mp3')

# English example using tts_models/en/vctk/vits (with multispeaker support)

items1 = []
items1.append(TTS_Item('This is a test:', speaker_idx=0))
items1.append(TTS_Item('This is another test:',  speaker_idx=1))

items2 = []
items2.append(TTS_Item('Another test',  speaker_idx=0))
items2.append(TTS_Item('This is getting boring!',  speaker_idx=1))

chapter = []
chapter.append(TTS_Chapter(items1, 'Chapter 1'))
chapter.append(TTS_Chapter(items2, 'Chapter 2'))

project = TTS_Project(chapter, 'Project title', 'This is a subtitle', author='Some author')

# Add a cover image
project.add_image_from_url('https://coqui.ai/static/38a06ec53309f617be3eb3b8b9367abf/598c3/logo-wordmark.png')

writer = TTS_Writer(project, '/tmp/tts_arranger_example_output/')
writer.synthesize_and_write(project.author + ' - ' + project.title)

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

tts_arranger-0.1.3.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

tts_arranger-0.1.3-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file tts_arranger-0.1.3.tar.gz.

File metadata

  • Download URL: tts_arranger-0.1.3.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for tts_arranger-0.1.3.tar.gz
Algorithm Hash digest
SHA256 db90076addacaa07e6374d12b33f201621116f224ed4f92d8f212bb0fd1d88e8
MD5 0b66d2bcd6772e3cc7089184f77e48f0
BLAKE2b-256 79b36501eb3c0523fc1b4ed0212670679c3e1dd8fc3eb495ae7c6e8208ab1d5e

See more details on using hashes here.

File details

Details for the file tts_arranger-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: tts_arranger-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for tts_arranger-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 aabb5cc0a0a13819df834435d7f1e77d6f1f1458aca112c268d4c2b339adcb86
MD5 b483ec781ddd03a8a0db207c1af5bf6c
BLAKE2b-256 7f1a8380cde89800c0b84cbc50f826dcabe512a4a07a0f061f120a55977ad15d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page