From 80977f9431fa730e587b01fe1007b18d9fa2f416 Mon Sep 17 00:00:00 2001 From: Johnny Huynh <27847622+johnnyhuy@users.noreply.github.com> Date: Tue, 9 Apr 2024 13:22:33 +1000 Subject: [PATCH] refactor: Improve parameters for audio transcription. - Update parameters for creating audio transcriptions in `transcribe_chunk` function - Refactor code for improved readability and maintainability --- transcribe_me/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transcribe_me/main.py b/transcribe_me/main.py index b95961b..be75a35 100644 --- a/transcribe_me/main.py +++ b/transcribe_me/main.py @@ -62,7 +62,7 @@ def transcribe_chunk(file_path: str) -> str: """ with open(file_path, "rb") as audio_file: try: - response = openai.audio.transcriptions.create(model="whisper-1", file=audio_file) + response = openai.audio.transcriptions.create(language="en", model="whisper-1", file=audio_file) return response.text except Exception as e: print(f"{Fore.RED}An error occurred while transcribing {file_path}: {e}")