Initial commit: media-to-text app

This commit is contained in:
Gan, Jimmy
2026-02-08 23:26:40 +08:00
commit b155e85040
44 changed files with 1396 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
#!/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"])