Skip to main content

A command-line tool to split a speech audio into separate sentences for language learners.

Project description

Speech Splitter

Test PyPI Version PyPI - Python Version Coverage Code style: black

Description

Speech Splitter is a command-line tool designed to split a speech audio into separate sentences. This tool aims to make it easier for language learners to train the hearing, pronounciation and word accents.

[!WARNING] It uses OpenAI API and requires an API key to work, which is not provided with the package. It can also be quite expensive to use, depending on the size of the book.

Motivation

This tool was developed by request of a Dutch teacher. She wanted to have a tool that would split the audio of a book into separate sentences, so that the students could listen to each sentence separately and repeat after it.

Installation

To install Speech Splitter, follow these steps:

pip install speech-splitter

It also requires ffmpeg to be installed on your system. You can install it using the following command (for Ubuntu):

sudo apt-get install ffmpeg or (for macOS or Windows) brew install ffmpeg or (for Windows) choco install ffmpeg

Usage

After installation, you can use the Speech Splitter tool directly from your command line. The basic command structure is as follows:

export OPENAI_API_KEY=your_api_key

Optionally, set the organization ID if you have one:

export OPENAI_ORG_ID=your_org_id

Run the command:

speech-split --help

Example Command

speech-split audio.mp3 ./output

This command will read audio.mp3, get the transcription, split it into sentences, align the audio fragments accordingly, and save the result as output/audio.html, that can be viewed by the browser.

Requirements

The dependencies will be installed automatically during the package installation process.

Feedback and Contributions

Your feedback and contributions are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue on the GitHub repository or submit a pull request with your changes.

License

MIT

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

speech_splitter-0.0.2.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

speech_splitter-0.0.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file speech_splitter-0.0.2.tar.gz.

File metadata

  • Download URL: speech_splitter-0.0.2.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for speech_splitter-0.0.2.tar.gz
Algorithm Hash digest
SHA256 6ec686fabe28ad3ed528e63d9231a09e61a534947f06b98229df88cd8a4f5a1b
MD5 0cd9a8eea3b8b204a44c8d5d5c0694c5
BLAKE2b-256 4257fd9c0b3e63dd9bb274a34f22ce103a679fc9b6b8d0edf6b036b2684c42f4

See more details on using hashes here.

File details

Details for the file speech_splitter-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for speech_splitter-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 83d8ff78a274e480235ef8cc78665a2b12457a39179f5c62919d6db831019e98
MD5 f9b7c2061cc5d0335a6e6d5e05fe2b89
BLAKE2b-256 72d09f3d33ab073d3765b65c8f6c9681711fdcb42bd68244c601bd0e96cc27e0

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