youngtsai commited on
Commit
d4257d0
·
1 Parent(s): b1a962b

'audio_file': ("audio", audio_file, 'audio/wav')

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -25,9 +25,11 @@ def score_audio_plus(password, audio, api_plan, return_json):
25
  }
26
 
27
  # Prepare files and data for POST request
28
- files = {
29
- 'audio_file': (audio.name, audio.file, 'audio/wav')
30
- }
 
 
31
  data = {
32
  'api_plan': api_plan,
33
  'return_json': "true" if return_json else "false"
 
25
  }
26
 
27
  # Prepare files and data for POST request
28
+ with open(audio, "rb") as audio_file:
29
+ files = {
30
+ 'audio_file': ("audio", audio_file, 'audio/wav')
31
+ }
32
+
33
  data = {
34
  'api_plan': api_plan,
35
  'return_json': "true" if return_json else "false"