Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

text-to-speech

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

text-to-speech

A versatile and user-friendly Python Text-to-Speech engine

  • 1.6.1
  • PyPI
  • Socket score

Maintainers
1

Text-to-Speech

PyPi Version MIT License

A versatile and user-friendly Python Text-to-Speech engine with customizable options.

Table of Contents

Installation

You can install the text-to-speech module using pip:

pip install text-to-speech

Usage

Basic Usage

You can use this module to convert text to speech and save it as an audio file. Here's a basic example:

from text_to_speech import save

text = "Hello, World!"
language = "en"  # Specify the language (IETF language tag)
output_file = "hello_world.mp3"  # Specify the output file (only accepts .mp3)

save(text, language, file=output_file)

Parameters

Here are the available parameters for the save function:

ParameterDescriptionDefault Value
textThe text to be converted to speech.
languageThe language (IETF language tag) to use for speech synthesis."en"
slowSet to True if you want the text to be read more slowly.False
fileThe name of the output audio file. Only accepts .mp3 format."speech.mp3"
lang_checkSet to True to check the text for language errors.False

Example with Slow Speech

You can make the speech slower by setting the slow parameter to True:

from text_to_speech import save

text = "This is a slow speech example."
language = "en"
output_file = "slow_speech.mp3"

save(text, language, slow=True, file=output_file)

Contributing

Contributions to this project are welcome. If you have any improvements or bug fixes, please submit a pull request.

License

This project is licensed under the MIT License.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc