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
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
tts_arranger-0.2.0.tar.gz
(19.3 kB
view details)
Built Distribution
File details
Details for the file tts_arranger-0.2.0.tar.gz
.
File metadata
- Download URL: tts_arranger-0.2.0.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d909739ebaaa928191b3c703c25ccb9f6b975bb78016e38d4945e7c121359a0c |
|
MD5 | fe767606b040d7edf07775c5159c3998 |
|
BLAKE2b-256 | 3858d1c22c391876d0e4e8c90083aafa6da8482ebe66a5bd257ef3b7fb5e1a6a |
File details
Details for the file tts_arranger-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: tts_arranger-0.2.0-py3-none-any.whl
- Upload date:
- Size: 21.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffb8c7c7bccc6abefca6add7bc73ebb2d98d963dd60a3a3b51f8e19e041b7bd0 |
|
MD5 | ca1636288cfddca0fd6b551a86f8e41a |
|
BLAKE2b-256 | b99917e4d2481d8d16a87f5cc43c01989a3da310d8244d9d6855e8f61b61c0c1 |