Vihang28 commited on
Commit
97f56b5
1 Parent(s): c5df392

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -12,9 +12,11 @@ prompt = "Type and press Enter"
12
  def record_text(audio_file,api_key):
13
  client = OpenAI(api_key = api_key)
14
  audio_file = open(audio_file, "rb")
15
- transcript = client.audio.transcribe("whisper-1", audio_file)
16
- text = transcript['text']
17
- return text
 
 
18
 
19
  # sound = audio_file
20
  # sound_type = sound.split(".")
 
12
  def record_text(audio_file,api_key):
13
  client = OpenAI(api_key = api_key)
14
  audio_file = open(audio_file, "rb")
15
+ transcript = client.audio.transcriptions.create(
16
+ model="whisper-1",
17
+ file=audio_file
18
+ )
19
+ return transcript
20
 
21
  # sound = audio_file
22
  # sound_type = sound.split(".")