Initial commit

This commit is contained in:
2025-03-26 22:53:10 +01:00
commit 4bc7e9054d
10 changed files with 307 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import sys
import whisper
def transcribe_audio(audio_path):
# Load the Whisper model
model = whisper.load_model("base")
# Transcribe the audio file
print(f"Transcribing: {audio_path} ...")
result = model.transcribe(audio_path, language="fr")
# Print and return transcription
transcription = result["text"]
print("\nTranscription:\n")
print(transcription)
return transcription
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: python transcribe.py path/to/audiofile")
else:
audio_file = sys.argv[1]
transcribe_audio(audio_file)