Spaces:
Runtime error
Runtime error
Commit
·
53aaa23
1
Parent(s):
36560ff
correct text type
Browse files
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:
|