Created
February 8, 2024 02:20
-
-
Save mseeks/9880a8fe5cc36c6c6f5992a4d4a4a434 to your computer and use it in GitHub Desktop.
Python code for transcribing audio using OpenAI's Whisper model.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import whisper | |
model = whisper.load_model("base") | |
# Load your audio file | |
audio_path = "path/to/your/audio.mp3" | |
# Transcribe the audio file | |
def transcribe_audio(audio_path): | |
result = model.transcribe(audio_path) | |
return result["text"] | |
# Example usage | |
transcription = transcribe_audio(audio_path) | |
print(transcription) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment