This script converts audio files to 16kHz and transcribes them using the Whisper model. The transcriptions are saved as text files.
- Python 3.x
ffmpeg
andffprobe
installed and available in your system's PATH- Whisper model and its dependencies
-
Clone the repository:
git clone <repository_url> cd <repository_directory>
-
Install dependencies:
Ensure you have
ffmpeg
andffprobe
installed. You can download them from FFmpeg's official website. -
Download the Whisper model:
Place the Whisper model file (
ggml-large-v3-q5_0.bin
) in themodels
directory.
Edit the script to set the correct paths for your input, output, and text output directories:
input_dir = "path/to/input_directory" output_dir = "path/to/output_directory" txt_output_dir = "path/to/txt_output_directory"
Run the script: python convertnwhisper.py
The script will:
- Loop through all audio files in the input directory.
- Convert audio files to 16kHz if they are not already.
- Transcribe the audio files using the Whisper model.
- Save the transcriptions as text files in the specified output directory.
The script logs its operations to conversion.log
. You can check this file for detailed information about the conversion and transcription processes.
This project is licensed under the MIT License. See the LICENSE file for details.
Make sure to replace <repository_url> and <repository_directory> with the actual URL and directory name of your repository.