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.1.4.tar.gz
(18.8 kB
view details)
Built Distribution
File details
Details for the file tts_arranger-0.1.4.tar.gz
.
File metadata
- Download URL: tts_arranger-0.1.4.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e626c809014c0b945160dc602386b36a7f7257d2e9da7c8b821591bbe09a635 |
|
MD5 | 90cd3d92ce7f02e702b4d02280a51fce |
|
BLAKE2b-256 | b3518d17df19a0ba55d496608c0d1a4ce9cc1c7e15749f7191017a56d2906909 |
File details
Details for the file tts_arranger-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: tts_arranger-0.1.4-py3-none-any.whl
- Upload date:
- Size: 21.2 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 | f9e0e51e8c43e6baef6b55c50aab3d920f9b2110495b7bc97b0b69362fa8d1eb |
|
MD5 | 69d12b62e343d480a85df9f89689de7c |
|
BLAKE2b-256 | a6ec3e1dbceede7903febbc710c12cebbf9bb05c5d04a8bcd61ddc057363e3e6 |