Skip to main content

Text To Speech In British Brian Voice

Project description

Text-to-Speech (TTS) using Edge TTS and Pygame

This Python script provides a simple implementation of text-to-speech (TTS) using the Edge TTS API and Pygame library for audio playback.

Requirements

  • Python 3.11.4
  • edge_tts module (for Edge TTS API)
  • Pygame library

Installation

  1. Install the required modules:
    pip install NetHyTech-HindiTTS
    

Usage

The Speak function in the script takes the text input and an optional output file path as arguments. If no output file path is provided, it saves the audio file as "speech.mp3" in the current directory.

Example usage:

from tts import Speak

text = "Hello, how are you?"
Speak(text, "output.mp3")  # Save audio to output.mp3

Functionality

  • The Speak function converts the input text to speech using the Edge TTS API and saves it to the specified output file.
  • If no output file is provided, it saves the audio as "speech.mp3" in the current directory.
  • The script handles the asynchronous operation using asyncio for better performance.
  • Pygame is utilized for playing the generated audio file.

Additional Notes

  • Ensure you have valid credentials for the Edge TTS API and replace the VOICE variable with the desired voice.
  • The remove_file function handles the removal of temporary files after audio playback.
  • Error handling is implemented to catch any exceptions during the process.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

NetHyTech_HindiTTS-0.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file NetHyTech_HindiTTS-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for NetHyTech_HindiTTS-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 01292eef875df3c732ee299fb34b4bbc3ed989ba1cd8afacb13a97387a6ab74d
MD5 5215a2dfc62fb8e9f089d30b98343a75
BLAKE2b-256 450eeda59a61db9137c24325c822a23ccf3739e8e02dd14a1df10af3286ec783

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