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.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for NetHyTech_HindiTTS-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e87143bd9df05404d016a3b96971f4fb5e1d38719946c4b438eae1964620b7bb
MD5 a721ce6740f7a2e22a0e4560995d7868
BLAKE2b-256 4528c8763ccbcd4cc33e28bfa9f34ead2a9b627b3aa221aad5ff8a98968c7988

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