Skip to content

Gtofig/whisper-transcribe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Audio Transcriber

A TypeScript application that transcribes audio files using OpenAI's Whisper API. It supports splitting large audio files into chunks to comply with the 25MB API limit.

Features

  • Transcribes WAV and MP3 audio files using OpenAI's Whisper API
  • Automatically splits large audio files into chunks
  • Adds timestamps to the transcription
  • Supports various transcription options (language, prompt, temperature)
  • Easy command-line interface

Prerequisites

  • Node.js (v14 or higher)
  • FFmpeg installed on your system
  • OpenAI API key

Installation

  1. Clone this repository:

    git clone https://github.com/gtofig/whisper-transcribe.git
    cd whisper-transcribe
  2. Install dependencies:

    npm install
  3. Create a .env file in the root directory with your OpenAI API key:

    OPENAI_API_KEY=your_openai_api_key_here
    
  4. Build the project:

    npm run build

Usage

Basic Usage

npm start -- -i /path/to/your/audio/file.mp3

The transcription will be saved to ./transcriptions/file_transcription.txt.

Advanced Options

npm start -- \
  -i /path/to/your/audio/file.mp3 \
  -o /path/to/output/directory \
  -m 20 \
  -l en \
  -p "This is a discussion about technology." \
  -t 0.2

Options

  • -i, --input: Path to the input audio file (required)
  • -o, --output: Output directory for transcriptions (default: ./transcriptions)
  • -m, --maxChunkSize: Maximum chunk size in MB (default: 25)
  • -l, --language: Language of the audio (ISO-639-1 code)
  • -p, --prompt: Prompt to guide the transcription
  • -t, --temperature: Temperature for the OpenAI API (default: 0)

Development

For development with hot-reloading:

npm run dev -- -i /path/to/your/audio/file.mp3

Dependencies

  • openai: Official OpenAI API client
  • fluent-ffmpeg: Node.js wrapper for FFmpeg
  • fs-extra: Enhanced file system operations
  • dotenv: Environment variable management
  • yargs: Command-line argument parsing

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors