Spaces:
Running
Running
Update speech_api.py
Browse files- speech_api.py +1 -1
speech_api.py
CHANGED
@@ -62,7 +62,7 @@ async def speech_to_text(file: UploadFile = File(...), source_language: str = "e
|
|
62 |
asr_result = client.asr(audio_content, source_language=source_language)
|
63 |
|
64 |
# Extract the transcribed text from the complex JSON structure
|
65 |
-
transcribed_text = asr_result['
|
66 |
|
67 |
return {"text": transcribed_text}
|
68 |
except KeyError:
|
|
|
62 |
asr_result = client.asr(audio_content, source_language=source_language)
|
63 |
|
64 |
# Extract the transcribed text from the complex JSON structure
|
65 |
+
transcribed_text = asr_result['pipelineResponse'][0]['output'][0]['source']
|
66 |
|
67 |
return {"text": transcribed_text}
|
68 |
except KeyError:
|