'audio_file': ("audio", audio_file, 'audio/wav')
Browse files
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 |
-
|
| 29 |
-
|
| 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"
|