Skip to main content

A command-line tool for audio transcription with Whisper and Pyannote.

Project description

Audio Scribe

A Command-Line Tool for Audio Transcription (Audio Scribe) and Speaker Diarization Using OpenAI Whisper and Pyannote

License

Current Working Badges

Pipeline Status PyPI version PyPI - Python Version PyPI - Downloads PyPI - License Coverage Report Coverage

Overview

Audio Scribe is a command-line tool that transcribes audio files with speaker diarization. Leveraging OpenAI Whisper for transcription and Pyannote Audio for speaker diarization, this solution converts audio into segmented text files, identifying each speaker turn. Key features include:

  • Progress Bar & Resource Monitoring: See real-time CPU, memory, and GPU usage with a live progress bar.
  • Speaker Diarization: Automatically separates speaker turns using Pyannote’s state-of-the-art models.
  • Tab-Completion for File Paths: Easily navigate your file system when prompted for the audio path.
  • Secure Token Storage: Encrypts and stores your Hugging Face token for private model downloads.
  • Customizable Whisper Models: Default to base.en, or specify tiny, small, medium, large, etc.

This repository is licensed under the Apache License 2.0.


Table of Contents


Features

  • Whisper Transcription
    Utilizes OpenAI Whisper to convert speech to text in multiple languages.
  • Pyannote Speaker Diarization
    Identifies different speakers and segments your audio output accordingly.
  • Progress Bar & Resource Usage
    Displays a live progress bar with CPU, memory, and GPU stats through alive-progress, psutil, and GPUtil.
  • Tab-Completion
    Press Tab to autocomplete file paths on Unix-like systems (and on Windows with pyreadline3).
  • Secure Token Storage
    Saves your Hugging Face token via cryptography for model downloads (e.g., pyannote/speaker-diarization-3.1).
  • Configurable Models
    Default is base.en but you can specify any other Whisper model using --whisper-model.

Installation

Installing from PyPI

Audio Scribe is available on PyPI. You can install it with:

pip install audio-scribe

After installation, the audio-scribe command should be available in your terminal (depending on how your PATH is configured). If you prefer to run via Python module, you can also do:

python -m audio-scribe --audio path/to/yourfile.wav

Installing from GitHub

To install the latest development version directly from GitHub:

git clone https://gitlab.genomicops.cloud/genomicops/audio-scribe.git
cd audio-scribe
pip install -r requirements.txt

This approach is particularly useful if you want the newest changes or plan to contribute.


Quick Start

  1. Obtain a Hugging Face Token

    • Create a token at Hugging Face Settings.
    • Accept the model conditions for pyannote/segmentation-3.0 and pyannote/speaker-diarization-3.1.
  2. Run the Command-Line Tool

    audio-scribe --audio path/to/audio.wav
    

    On the first run, you’ll be prompted for your Hugging Face token if you haven’t stored one yet.

  3. Watch the Progress Bar

    • The tool displays a progress bar for each diarized speaker turn, along with real-time CPU, GPU, and memory usage.

Usage

Below is a summary of the main command-line options:

usage: audio-scribe [options]

Audio Transcription (Audio Scribe) Pipeline using Whisper + Pyannote, with optional progress bar.

optional arguments:
  --audio PATH           Path to the audio file to transcribe.
  --token TOKEN          HuggingFace API token. Overrides any saved token.
  --output PATH          Path to the output directory for transcripts and temporary files.
  --delete-token         Delete any stored Hugging Face token and exit.
  --show-warnings        Enable user warnings (e.g., from pyannote.audio). Disabled by default.
  --whisper-model MODEL  Specify the Whisper model to use (default: 'base.en').

Examples:

  • Basic Transcription

    audio-scribe --audio meeting.wav
    
  • Specify a Different Whisper Model

    audio-scribe --audio webinar.mp3 --whisper-model small
    
  • Delete a Stored Token

    audio-scribe --delete-token
    
  • Show Internal Warnings

    audio-scribe --audio session.wav --show-warnings
    
  • Tab-Completion

    audio-scribe
    # When prompted for an audio file path, press Tab to autocomplete
    

Dependencies

Core Libraries

Optional for Extended Functionality

Sample requirements.txt

Below is a typical requirements.txt you can place in your repository:

torch>=1.9
openai-whisper
pyannote.audio
pytorch-lightning
cryptography
keyring
alive-progress
psutil
GPUtil
pyreadline3; sys_platform == "win32"

Note:

  • pyreadline3 is appended with a PEP 508 marker (; sys_platform == "win32") so it only installs on Windows.
  • For GPU support, ensure you install a compatible PyTorch version with CUDA.

Contributing

We welcome contributions to Audio Scribe!

  1. Fork the repository and clone your fork.
  2. Create a new branch for your feature or bugfix.
  3. Implement your changes, ensuring code is well-documented and follows best practices.
  4. Open a pull request, detailing the changes you’ve made.

Please read any available guidelines or templates in our repository (such as CONTRIBUTING.md or CODE_OF_CONDUCT.md) before submitting.


License

This project is licensed under the Apache License 2.0.

Copyright 2025 Gurasis Osahan

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Thank you for using Audio Scribe!
For questions or feedback, please open a GitHub issue or contact the maintainers.

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

audio_scribe-0.1.1.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

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

audio_scribe-0.1.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file audio_scribe-0.1.1.tar.gz.

File metadata

  • Download URL: audio_scribe-0.1.1.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for audio_scribe-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c9b0d798b25110050da6a038f9b6d0907b3b27d6df91562ddb5f842a0d372cf2
MD5 9473c7c88a91c9af8a64caa13f1fc3db
BLAKE2b-256 ee768294c4fa0174a08693529a2d4d3eaa6f0fb5babc11a7b9e6cc1e29ce673b

See more details on using hashes here.

File details

Details for the file audio_scribe-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: audio_scribe-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for audio_scribe-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c984edac9a6f7018b2afe108d65e91ed9dcae5c63cb43e60b994729ff9818ff
MD5 03b5d74fc14427d4f4ce7a11d31cc053
BLAKE2b-256 39931029b1c0dd33c52f7179b3a9a4e2d79378abf3a98d238745fd5944d3287c

See more details on using hashes here.

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