diff --git a/ayushma/utils/speech_to_text.py b/ayushma/utils/speech_to_text.py index e81f97f0..c08f5947 100644 --- a/ayushma/utils/speech_to_text.py +++ b/ayushma/utils/speech_to_text.py @@ -1,4 +1,3 @@ -import json import os import openai @@ -43,7 +42,6 @@ def recognize(self, audio): config = speech.RecognitionConfig( encoding=speech.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED, - sample_rate_hertz=48000, language_code=self.language_code, ) @@ -51,13 +49,13 @@ def recognize(self, audio): if not response.results: return "" return response.results[0].alternatives[0].transcript - + + class SelfHostedEngine: def __init__(self, api_key, language_code): self.language_code = language_code def recognize(self, audio): - response = requests.post( settings.SELF_HOSTED_ENDPOINT, files={"audio": audio},