File size: 230 Bytes
34552ed
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
# stt.py
import whisper

print("Loading Whisper model...")
model = whisper.load_model("base")
print("Whisper loaded")

def speech_to_text(audio_path: str) -> str:
    result = model.transcribe(audio_path)
    return result["text"]