OuroborosM commited on
Commit
53aaa23
·
1 Parent(s): 36560ff

correct text type

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -334,7 +334,8 @@ def speech_to_text(Filename_Audio_input_single):
334
 
335
  response = requests.post(endpoint, headers=headers, data=open(Filename_Audio_input_single, "rb"))
336
  print("Speech to Text Raw: ", response.text)
337
- text_from_audio = response.text('DisplayText')
 
338
  print("Speech to Text: ", text_from_audio)
339
  return text_from_audio
340
  except requests.exceptions.RequestException as e:
 
334
 
335
  response = requests.post(endpoint, headers=headers, data=open(Filename_Audio_input_single, "rb"))
336
  print("Speech to Text Raw: ", response.text)
337
+ text_from_audio = response.text.split('DisplayText":"')[1].split('."}')[0]
338
+ # text_from_audio = response.text('DisplayText')
339
  print("Speech to Text: ", text_from_audio)
340
  return text_from_audio
341
  except requests.exceptions.RequestException as e: