Skip to content

Automate Audio Transcription with OpenAI: Fast, Accurate, and Easy!

License

Notifications You must be signed in to change notification settings

Marco-26/audio-transcriber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Audio Transcription Tool

This Python script is designed to transcribe audio files using the OpenAI API. It splits large audio files into smaller chunks, transcribes each chunk separately, and then combines the transcriptions into a single text file.

Prerequisites

Before using this tool, make sure you have the following installed:

  • Python 3.0
  • openai Python package (pip install openai)
  • pydub Python package (pip install pydub)
  • ffmpeg (https://ffmpeg.org/)
  • An OpenAI API key set as an environment variable named OPENAI_API_KEY

Alternatively, you can install all dependencies by running:

pip install -r requirements.txt

This command will install all the required packages listed in the requirements.txt file. Make sure to set up your OpenAI API key as mentioned above. You still have to manually install ffmpeg.

Usage

python transcribe.py <audio_file_path> <transcribed_file_name>
  • <audio_file_path>: Path to the audio file you want to transcribe.
  • <transcribed_file_name>: Name of the file containing the content of the transcribed audio

Features

  • Audio Splitting: Large audio files are automatically split into smaller chunks for efficient transcription.
  • Transcription: Transcribes audio files using the OpenAI API, either as a single chunk or multiple chunks.
  • Output: Saves the transcript as a text file.

Recommendations

  • Audio Compression: It's highly recommended to compress the audio file before using this script for better performance and faster transcription.
  • File Size Limitation: This tool is optimized for audio files of up to 25 minutes in duration. Larger files will be split into multiple chunks for transcription.

Example

python transcribe.py example_audio.mp3 myTranscription

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributors

  • @Marco-26 - Marco Costa

Feel free to contribute by submitting bug reports, feature requests, or pull requests!

Releases

No releases published

Packages

No packages published

Languages