interstellar_ai/py/voice.py

11 lines
231 B
Python
Raw Normal View History

2024-09-26 11:01:15 +02:00
import whisper
2024-09-24 09:55:23 +02:00
class VoiceRecognition:
2024-09-26 11:01:15 +02:00
@staticmethod
def recognition(audio):
model = whisper.load_model("base")
result = model.transcribe(audio)
print(result["text"])
return result["text"]