Skip to main content

Generate audio from text documents

Project description

jmes-tts

Generate audio books from text documents

Installation

pip install jmes-tts

Development

This project requires Python 3.12 and uses uv to manage dependencies.

You can create a virtual environment with all the necessary dependencies by running:

uv sync --all-extras --dev

This will install all necessary dependencies and install this project in editable mode.

You can activate the venv with:

. .venv/bin/activate

Testing

Poe the Poet is the task runner used for this project, it's automatically installed as part of the dev dependencies. To see a list of available tasks, run the poe command with no args.

To run the tests for this project run:

poe test

Before submitting a PR, ensure the prcheck task runs successfully:

poe prcheck

Usage

The jmes-tts command is the main interface for converting text to speech. It offers several options to customize the conversion process.

Basic Usage

jmes-tts --text "Hello, world!" --output hello.mp3

This will convert the text "Hello, world!" to speech and save it as "hello.mp3".

Command Options

  • --filename: Input file to convert to speech
  • --text: Text to convert to speech
  • --bucket: S3 bucket for long-form text (optional)
  • --output: Output audio file (default: output.mp3)
  • --language: Language of phrase (default: english)
  • --language-code: Language code override (optional)
  • --voice: Voice to use for text-to-speech (optional)
  • --engine: TTS engine (optional)
  • --list-languages: List language presets and Polly language codes

Supported --language values:

  • english (default)
  • french
  • spanish
  • cantonese
  • mandarin

Run jmes-tts --list-languages to see all presets and the full list of supported language codes.

Converting a File

For longer texts, you can specify an S3 bucket and the path to a local file:

jmes-tts --filename long_text.txt --bucket my-s3-bucket --output long_audio.mp3

Notes

  • You must provide either --filename or --text, but not both.
  • If your text is larger than 3000 (billable) characters, you need to provide the --bucket argument. Otherwise synchronous TTS will be used.
  • If no output file is specified, the audio will be saved as output.mp3 in the current directory.

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

jmes_tts-0.0.1.tar.gz (54.3 kB view details)

Uploaded Source

Built Distribution

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

jmes_tts-0.0.1-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file jmes_tts-0.0.1.tar.gz.

File metadata

  • Download URL: jmes_tts-0.0.1.tar.gz
  • Upload date:
  • Size: 54.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for jmes_tts-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b7c6e89b984a9c0b4afb4a26da51502af500d91ad63673014bdfe1952b92c889
MD5 9645dc9a91f25d5ccba6a51c0e26eb21
BLAKE2b-256 aa0455c5c28ec08a7c354868aa29d62481abd3e1ebe5ab6ff401af7bfc2e2f9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for jmes_tts-0.0.1.tar.gz:

Publisher: publish.yml on jamesls/jmes-tts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jmes_tts-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: jmes_tts-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for jmes_tts-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d53cb78ebcf8adec07b197a8123bd63c56a5c24b730b0e752a6d074234240900
MD5 c97134c9d11f516f16279c96e5d14c85
BLAKE2b-256 591dd3479387f9465f651b7c6873a6b435415a95737c8d746ab4da2d8977a380

See more details on using hashes here.

Provenance

The following attestation bundles were made for jmes_tts-0.0.1-py3-none-any.whl:

Publisher: publish.yml on jamesls/jmes-tts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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