Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -17,8 +17,8 @@ def audio_to_bytes(audio):
|
|
17 |
def langswitch_API_call(audio, language):
|
18 |
audio_bytes = audio_to_bytes(audio)
|
19 |
files = {'file': (f'audio_chunk.wav', audio_bytes, 'audio/wav')}
|
20 |
-
|
21 |
-
response = requests.post(
|
22 |
if response.status_code != 200:
|
23 |
print(response)
|
24 |
raise Exception("API error")
|
|
|
17 |
def langswitch_API_call(audio, language):
|
18 |
audio_bytes = audio_to_bytes(audio)
|
19 |
files = {'file': (f'audio_chunk.wav', audio_bytes, 'audio/wav')}
|
20 |
+
api_url = os.getenv("api_url")
|
21 |
+
response = requests.post(f"{api_url}/online/http?language={language}", files=files)
|
22 |
if response.status_code != 200:
|
23 |
print(response)
|
24 |
raise Exception("API error")
|