Skip to main content

A simple tool to transcribe audio files

Project description

Transcriber

A flexible Python package for transcribing audio and video from various sources (SoundCloud, YouTube, or local files) into multiple text formats (txt, docx, srt). The transcriber supports multiple speech recognition models (defaulting to Whisper "large-v3"). It leverages GPU acceleration for faster processing and utilizes concurrency through async and multiprocessing to improve performance.

Features

  • Multiple Input Sources: Transcribe from SoundCloud, YouTube, or local audio/video files
  • Multiple Models: Support for both faster-whisper and standard whisper models
  • GPU Acceleration: Utilize GPU processing for faster transcription
  • Concurrent Processing: Batch processing and VAD filtering for improved performance
  • Various Output Formats: Export transcriptions to multiple formats
  • Progress Tracking: Rich progress bars showing transcription status
  • Configurable: Extensive configuration options via environment variables or settings

Requirements

  • Python 3.11 or higher
  • GPU support (optional but recommended for better performance)

Installation

  • Install the package from PyPI:

    uv pip install Transcriber
    

Configuration

  • Copy the example environment file:

    cp .env.example .env
    
  • Configure the settings in .env:

    # Input settings
    INPUT__URLS_OR_PATHS=["Audio_To_Transcribe"]
    INPUT__SKIP_IF_OUTPUT_EXIST=false
    
    # Output settings
    OUTPUT__OUTPUT_FORMATS=["all"]
    OUTPUT__OUTPUT_DIR="Transcripts"
    
    # Whisper model settings
    WHISPER__LANGUAGE="ar"
    
    # Logging settings
    LOGGING__LOG_LEVEL="DEBUG"
    LOGGING__ENABLE_LOGFIRE=true
    LOGGING__LOGFIRE_TOKEN="<your_logfire_token>"
    

Usage

Basic Usage

from Transcriber.transcriber import transcribe

# Configure the transcriber via .env or parameters, then:
transcribe(
    urls_or_paths=["path/to/audio.mp3", "https://youtube.com/watch?v=example"],
    output_dir="Transcripts",
    output_formats=["txt", "srt"],
    language="ar",
    log_level="INFO",
    enable_logfire=True,  # Optional
    logfire_token="<your_logfire_token>"  # Optional, you can get it from https://logfire.pydantic.dev/login
)

Command Line Usage

uv run --with Transcriber transcribe

Example Configuration

# Example settings in your .env file
INPUT__URLS_OR_PATHS=["path/to/audio.mp3", "https://youtube.com/watch?v=example"]
OUTPUT__OUTPUT_FORMATS=["txt", "srt"]
WHISPER__LANGUAGE="en"

Acknowledgments

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

transcriber-0.1.18.tar.gz (78.6 kB view details)

Uploaded Source

Built Distribution

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

transcriber-0.1.18-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file transcriber-0.1.18.tar.gz.

File metadata

  • Download URL: transcriber-0.1.18.tar.gz
  • Upload date:
  • Size: 78.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.10

File hashes

Hashes for transcriber-0.1.18.tar.gz
Algorithm Hash digest
SHA256 f0d64b0824a67081df82a1efd3b788ce8a513271d4244f87d479a7d8a38e3858
MD5 45e608b42868654771a2827f899cb11c
BLAKE2b-256 3b8eb212227bc1972586e243fa18bf76f4c30086e9bbc6acca45448db9b88714

See more details on using hashes here.

File details

Details for the file transcriber-0.1.18-py3-none-any.whl.

File metadata

File hashes

Hashes for transcriber-0.1.18-py3-none-any.whl
Algorithm Hash digest
SHA256 1a6fd49fe250b5b82aeae9aba1efc7a424c2f5865c39036eeddac6b9919f9de4
MD5 da1737088ab76b80e3102d7345e5f48f
BLAKE2b-256 b3cba6b002942a49cb4a6dc866e6822d88e06c65a9f9042ee37cfd28327d7080

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