Skip to main content

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

Project description

TTS Arranger

A set of classes that simplify arranging text fragments with multiple speakers and processing it using coqui.ai TTS.

Examples

#!/usr/bin/python3
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', 'ED\n', 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/test2.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, 'Projektname', 'Dies ist ein Untertitel', author='Ein Autor', lang_code='de')

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.0.9.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

tts_arranger-0.0.9-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tts_arranger-0.0.9.tar.gz
  • Upload date:
  • Size: 18.3 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.0.9.tar.gz
Algorithm Hash digest
SHA256 0ac22017cd7bf63efa74eafc3c3304ec52f612e18afcb61926257c06e9d6e10a
MD5 1c98b3a94db28c125a8f4286d84225fc
BLAKE2b-256 045b0216ca89484874dcf02d4c332a06c7144198017531bbf98b916cc20c6b7a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tts_arranger-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 20.6 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.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 35cff3f4331f2c904903d0bb4756b21979d32122ab9dd01c4611d289fdf6f7d8
MD5 405174de88479911a7891cb8f0f37288
BLAKE2b-256 d3c9af35627710df05632607b8d1d61bdd3c57c12727ecc4cb9c78a1cad54c83

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