Skip to main content

A Python package for text-to-speech conversion using DeepAI API.

Project description

Speech Synthesis with DeepAI API

This Python script uses the DeepAI API to convert text to speech and play the resulting audio. It allows you to choose from various voices provided by DeepAI.

pip

from NetHyTech_DeepTTS import speak

speak("i dont know sir but i am felling not good today",l)

Prerequisites

Before running the script, ensure you have the following installed:

  • Python 3.11.4
  • playsound library
  • requests library

You can install the required libraries using pip:

pip install playsound requests

Parameters

  • text (str): The text you want to convert to speech.
  • model (str, optional): The voice model to use. Defaults to "aura-luna-en".
  • filename (str, optional): The name of the temporary file to save the audio. Defaults to "data.mp3".

Voice Models

You can choose from the following voice models:

  • "aura-asteria-en": Sophia (Female US English)
  • "aura-luna-en": Emily (Female US English)
  • "aura-stella-en": Rachel (Female US English)
  • "aura-athena-en": Eliza (Female UK English)
  • "aura-hera-en": Pam (Female US English)
  • "aura-orion-en": Kevin (Male US English)
  • "aura-arcas-en": Jeff (Male US English)
  • "aura-perseus-en": Alex (Male US English)
  • "aura-angus-en": Rory (Male Irish English)
  • "aura-orpheus-en": John (Male US English)
  • "aura-helios-en": Pete (Male UK English)
  • "aura-zeus-en": James (Male US English)

Example

Here's an example of how to use the speak function:

speak("i dont know sir but i am felling not good today",l) 

This will convert the text "Hello, this is a test message." to speech using the "aura-luna-en" (Emily, Female US English) voice model and play the resulting audio.

Notes

  • Ensure you have an active internet connection as the script makes a request to the DeepAI API.
  • Make sure to handle API keys securely if required by the DeepAI API for authentication.
  • The temporary audio file is deleted after playing to keep your directory clean.

Troubleshooting

  • If you encounter an error, check the status code and response text returned by the API for more details.
  • Ensure the playsound and requests libraries are properly installed.

Created by NetHyTech (Anubhav Chaturvedi)

"Author of [NetHyTech_DeepTTS] is Anubhav Chaturvedi" "Youtube : https://youtube.com//@nethytech "

License

This script is provided as-is without any warranty. Use at your own risk.

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

NetHyTech-DeepTTS-1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

NetHyTech_DeepTTS-1.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file NetHyTech-DeepTTS-1.0.tar.gz.

File metadata

  • Download URL: NetHyTech-DeepTTS-1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.4

File hashes

Hashes for NetHyTech-DeepTTS-1.0.tar.gz
Algorithm Hash digest
SHA256 b33d04bc5f4a4c9691f4f90814020c91869adf1b72fb2a14535d9195acd2bc55
MD5 f2b74d029179f44bfda2790a491c3f9c
BLAKE2b-256 57f467788a6f0ebe94ce7625845253980c4ac26b3a8fd7d2325b7c58596a26b1

See more details on using hashes here.

File details

Details for the file NetHyTech_DeepTTS-1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for NetHyTech_DeepTTS-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05bb1ff6395365b5fa3221cfba6ea90314e78f75519605b5e6ef004144219960
MD5 535fc180bbad046bbd4a2061e1ac0f2f
BLAKE2b-256 c230b8a949bc8aba2757f048e1bb165e5e77e549771dbee1742bcae31ba07165

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