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
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, '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/', output_format='mp3')
writer.synthesize_and_write(project.author + ' - ' + project.title, concat=False)
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.1.0.tar.gz
(18.4 kB
view details)
Built Distribution
File details
Details for the file tts_arranger-0.1.0.tar.gz
.
File metadata
- Download URL: tts_arranger-0.1.0.tar.gz
- Upload date:
- Size: 18.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cdf48dfe3ac2a1cce83482a9abf2915226f7c1d57dd39c42d21323bc2282dd1 |
|
MD5 | e9d35cf7f66199e2e78a51729d92fc30 |
|
BLAKE2b-256 | 97864927505ed0e1f325b5104b7912a8882564608dd53d3ef4427840222002af |
File details
Details for the file tts_arranger-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: tts_arranger-0.1.0-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 460e12330d023aeab26c059fc70c6b1280b44db2a1a46fe3567ff9791b9225fe |
|
MD5 | 13f9841153b610f93f8265798af25cd4 |
|
BLAKE2b-256 | 5404c06c1f9a79a6b617f36b8366b72d39b652ae4793ea0a169d99ed56d9cca5 |