Skip to main content

Package for realistic voice synthesis

Project description

voicesynth

Voice Synthesizing Library

[!NOTE] The project uses Silero TTS

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("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 need:

import time

synthesizer.synthesize("Whats'up!", path="audio.wav")
time.sleep(3)
synthesizer.audio.play_audio("audio.wav")

The library automatically handles cross-platform audio playback natively. You don't need to specify different modules for different operating systems:

model = Model("v4_ru", "model_ru.pt")
synthesizer = Synthesizer(model)

# Automatically plays using the most reliable native method 
# (e.g., playsound on Windows, paplay/PipeWire/ALSA on Linux, afplay on macOS)
synthesizer.say("Как дела?") 
synthesizer.say("Хорошо, а твои как?")

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

voicesynth-0.3.3-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: voicesynth-0.3.3.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.9

File hashes

Hashes for voicesynth-0.3.3.tar.gz
Algorithm Hash digest
SHA256 928e97b3248075160b07e34657dd51a2655212709dbd2dbe7fac7a447144b8c0
MD5 3e83569d7b26c1bd3ecd57f0adbe6998
BLAKE2b-256 ca216fd3c8b2a564e618dc660457ebaf2be15a141fd1fccfc2c5fbbe67f0c6e5

See more details on using hashes here.

File details

Details for the file voicesynth-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: voicesynth-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.9

File hashes

Hashes for voicesynth-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 673b71ad9824e46f8f3e493f9e790ae2a4ce93f9b38fff9a5266beac23e9917d
MD5 d58d5ba1b4b56f923659835a981ca2b7
BLAKE2b-256 95271cfac1a59a1c8f5ec6586e572a9d02d8a6379228046ec1816fe03de11c43

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page