andercorral commited on
Commit
a96b890
·
verified ·
1 Parent(s): a12adfc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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
- data = {'language': language}
21
- response = requests.post(os.getenv("api_url"), files=files, data=data)
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")