audio diarizer and automatic speech recognition cli tool
Project description
transaud Description
A command-line tool for speaker-attributed transcription using pyannote for speaker
diarization and Whisper Turbo for speech-to-text. The tool produces readable,
timestamped transcripts with speaker labels.
Overview
This tool performs the following steps:
- Converts the input audio file to a temporary WAV format.
- Runs speaker diarization to detect speaker turns.
- Transcribes each speaker’s audio segment using Whisper Turbo.
- Writes a formatted transcript grouped by speaker and timestamp. GPU acceleration is automatically enabled when available, with a CPU fallback.
Usage
poetry run transcribe -iaf /path/to/audio/file.ext
Optional arguments
--num-speakers: Specify the number of speakers if known (improves diarization).--line-length: Set maximum line width for wrapped transcript text.--output-text-file: Specify a custom output file path.
Output
The generated transcript:
- Groups consecutive speech from the same speaker
- Includes timestamps
- Uses hanging indentation for readability If no output file is specified, a .txt file is created using the input audio filename.
Dependencies
torchtransformerspyannote.audio(for diarization output)tqdmffmpeg(system dependency)
Environment variables.
Hugging Face Authentication (Required)
This project uses pretrained models hosted on Hugging Face.
- Generate a new huggingface token if you don't have one from hf tokens.
- Approve access to the pyannote diarization model - link
- Create a .env file in the project root
HF_TOKEN=your_token_here
- Ensure environment variables are loaded into your shell:
export HF_TOKEN=your_token_here
Security Notice
[!Caution] This module loads pretrained models from trusted Hugging Face repositories. Ensure model sources are trusted when running in production environments.
Known Issues
Apple Silicon (macOS)
On Apple Silicon machines, you may encounter issues related to torchcodec or audio decoding. If so, update your ffmpeg library path:
export DYLD_LIBRARY_PATH="/opt/homebrew/lib:$DYLD_LIBRARY_PATH"
Notes
- Converting audio to WAV internally ensures consistent behavior across systems.
- For best results, provide --num-speakers when the number of speakers is known.
- Long recordings may require significant memory when running on CPU.
Model Licenses
This package does not ship any pretrained models. Models are downloaded at runtime from Hugging Face and are subject to their respective licenses:
- Whisper Turbo: OpenAI license
- pyannote speaker diarization: pyannote community license Users are responsible for reviewing and complying with these licenses.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file transaud-0.1.0.tar.gz.
File metadata
- Download URL: transaud-0.1.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.11.7 Darwin/23.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
394c21cb67fd99cb97859da8938b451235d2e1bbd0c3be4f7179d6ec3872f1e1
|
|
| MD5 |
c1b716453f474a747583073e75747ee3
|
|
| BLAKE2b-256 |
9178252ca0b36c8c8f11ebe8baa6fcc09a6ea237ffc4b56ead29ffd45d167afb
|
File details
Details for the file transaud-0.1.0-py3-none-any.whl.
File metadata
- Download URL: transaud-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.11.7 Darwin/23.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
961a365dd1040b2e234cec884c1f9021bdfc17cf9e7547d6ca617b3023bcc549
|
|
| MD5 |
3412c3f10fac700afb275beb6414362a
|
|
| BLAKE2b-256 |
9e759797a43410ae69948ab94fedae029fe341d4e56858a958d47d8c7063d295
|