Package for realistic voice synthesis
Project description
voicesynth
Voice Synthesizing Library[!NOTE] The project uses Silero TTS
How to use:
First, install the packagepip install voicesynth
Then import it into your code and go ahead and use it:
from voicesynth import Model, Synthesizer, show_available_models
show_available_models() # Showcase of all tts models available
# initializing the model
# setting show_download to False does not show model downloading progress
model = Model("v3_en", model_path="model.pt", show_download=False)
model.set_speaker("en_73")
# creating a synthesizer instance
synthesizer = Synthesizer(model)
synthesizer.say("This is a good way to spend my day!")
Instead of using .say() method, you can synthesize an audio and then play it whenever you want
import time
synthesizer.synthesize("Whats'up!", path="audio.wav")
time.sleep(3)
synthesizer.audio.play_playsound("audio.wav")
There are multiple ways to play a synthesized audio:
model = Model("v4_ru", "model_ru.pt")
synthesizer = Synthesizer(model)
synthesizer.say("Как дела?", module="pygame") # Using pygame.mixer to play the audio
synthesizer.say("Хорошо, а твои как?", module="pydub") # Using pydub to play the audio
There are three ways to play the audio:
synthesizer.audio.play_playsound("audio.wav")
synthesizer.audio.play_pygame("audio.wav")
synthesizer.audio.play_pydub("audio.wav")
All models support simple ssml tags:
synthesizer.say("В н+едрах т+ундры в+ыдры п+ели п+есни", prosody_rate=90)
# I added prosody as a parameter, so that people who are not familiar with ssml tags
# could change speaking speed without knowing how to manually do it
By default, logging is enabled. If it bothers you, you can disable it
from voicesynth import disable_logging
disable_logging()
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
voicesynth-0.2.3.tar.gz
(10.3 kB
view details)
Built Distribution
File details
Details for the file voicesynth-0.2.3.tar.gz
.
File metadata
- Download URL: voicesynth-0.2.3.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7bc1c578134f2e7468fccea797e03e5105d83324dc6728859e6fa345e572ecd |
|
MD5 | 9d9ff4f268e53ec46dc86261a8d60ce1 |
|
BLAKE2b-256 | 6f88996e47eba9e1a76651e972f7ea8e3c958dc7dd4ca95f7841b46cea885c9d |
File details
Details for the file voicesynth-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: voicesynth-0.2.3-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2172dea9fadbd47220ee3d0673a6a8da7793dcfbd4c127f827203c2b0aa25ce9 |
|
MD5 | 855c099b61686cc022714d683da2fc22 |
|
BLAKE2b-256 | 8b0bd938842c345817d5f0298ec4ac9f25c9c5be8865b51a5b9987aa098f5bca |