FREE & OFFLINE Audio to Text | Whisper: Install Guide | OpenAI Whisper | ASR
Table of Contents
Introduction
In this tutorial, you will learn how to install OpenAI’s Whisper, a powerful audio-to-text transcription tool that works offline and is completely free. By following this guide, you will be able to transcribe audio files into text in various languages directly from your computer, without any subscriptions or fees.
Step 1: Check if Python is Installed
Before you can install Whisper, you need to ensure that Python is installed on your machine.
- Open a command prompt (Windows) or terminal (Mac/Linux).
- Type the following command to check the Python version:
python --version
- If Python is not installed or if the version is below 3.9.9, proceed to download the latest version.
Step 2: Download Python 3.9.9
To download Python, follow these steps:
- Visit the official Python download page at Python 3.9.9.
- Choose the installer that matches your operating system (Windows, Mac, or Linux).
- Run the installer and ensure to check the box that says "Add Python to PATH" during installation.
Step 3: Handle Multiple Python Versions
If you have multiple versions of Python installed, you can specify which version to use.
- Use the command:
python3.9 --version
- This ensures you're using the correct version (3.9.9) for Whisper.
Step 4: Install CUDA for NVIDIA Users
If you are using an NVIDIA GPU, install CUDA for better performance with Whisper.
- Go to the CUDA 11.6 download page.
- Download and install the appropriate version for your operating system.
- Follow any specific instructions provided during the installation process.
Step 5: Install PyTorch
Whisper relies on PyTorch, which needs to be installed next.
- Visit the PyTorch installation page.
- Select your preferences (OS, package manager, Python version, and CUDA version).
- Copy the provided installation command and run it in your command prompt or terminal. It will look something like this:
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
Step 6: Install FFMPEG
FFMPEG is essential for processing audio files. Here’s how to install it:
- Go to the FFMPEG download page.
- Download the build suitable for your operating system.
- Follow the installation instructions provided on the site. Ensure that FFMPEG is added to your system PATH to access it from the command line.
Step 7: Install Whisper
Now that all prerequisites are in place, you can install Whisper.
- Open your command prompt or terminal.
- Run the following command:
pip install git+https://github.com/openai/whisper.git
- Wait for the installation to complete.
Step 8: Get Help and Command Reference
To familiarize yourself with Whisper's commands:
- Type the following command in your terminal:
whisper --help
- This will display a list of available commands and usage instructions.
Step 9: Basic Whisper Usage
To transcribe audio files using Whisper:
- Use the following command to transcribe an MP3 file:
whisper your_audio_file.mp3 --language English
- Replace
your_audio_file.mp3
with the path to your audio file.
Step 10: Transcribe MP3 to Text
Follow these steps to transcribe your audio:
- Ensure your audio file is ready and located in an accessible directory.
- Run the transcription command as shown in Step 9.
- The output will be saved as a text file in the same directory as the audio file.
Conclusion
You've successfully installed OpenAI's Whisper and learned how to transcribe audio files into text. This tool is a powerful resource for anyone needing offline transcription capabilities. Experiment with different audio files and languages to fully utilize Whisper's capabilities. If you encounter any issues, consult the command reference for troubleshooting tips. Happy transcribing!