#!/usr/bin/env python3
import sys
import whisper

if len(sys.argv) < 2:
    print("Usage: python transcribe.py <audio_or_video_file> [language]")
    print("Example: python transcribe.py audio.mp3 es")
    sys.exit(1)

model = whisper.load_model("base")
language = sys.argv[2] if len(sys.argv) > 2 else None
result = model.transcribe(sys.argv[1], language=language)
print(result["text"])
