Skip to main content

Package for realistic voice synthesis

Project description

VoiceSynth

Voice Synthesizing Library

How to use:

First, install the package
pip 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("v4_ru", model_path="model.pt", show_download=False)  
model.set_speaker("eugene")

# creating a synthesizer instance
synthesizer = Synthesizer(model)
synthesizer.say("Я представить себе не могу, что это действительно случилось!")

Instead of using .say() method, you can synthesize an audio and then play it whenever you want

import time

synthesizer.synthesize("Всем привет!", path="audio.wav")
time.sleep(3)
synthesizer.play_playsound("audio.wav")

There are multiple ways to play a synthesized audio:

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


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

Uploaded Source

File details

Details for the file voicesynth-0.1.2.tar.gz.

File metadata

  • Download URL: voicesynth-0.1.2.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for voicesynth-0.1.2.tar.gz
Algorithm Hash digest
SHA256 aac26decdfb2ff7c2511a91efdcfb409712388b36a5b3451abd0752cdd7d3d74
MD5 01ff505c6d83d778b01b29158aafff60
BLAKE2b-256 34479bc7cd2c5264ea02aa6e23575c55e01add39cda559b344d0ae3378a65e64

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