Update API_Main.py
Browse files- API_Main.py +2 -2
API_Main.py
CHANGED
|
@@ -66,11 +66,11 @@ async def Inference(text : str, lang : str, speaker_wav : UploadFile):
|
|
| 66 |
|
| 67 |
speaker_wav_filename = "temp/" + random_string + "_" + speaker_wav.filename
|
| 68 |
|
| 69 |
-
with open(speaker_wav_filename , "
|
| 70 |
wavFile.write(await speaker_wav.file.read())
|
| 71 |
|
| 72 |
try:
|
| 73 |
-
with wave.open(speaker_wav_filename) as temper:
|
| 74 |
pass
|
| 75 |
except:
|
| 76 |
return JSONResponse({"comment" : "Audio file format not supported."}, status_code = 422)
|
|
|
|
| 66 |
|
| 67 |
speaker_wav_filename = "temp/" + random_string + "_" + speaker_wav.filename
|
| 68 |
|
| 69 |
+
with open(speaker_wav_filename , "wb") as wavFile:
|
| 70 |
wavFile.write(await speaker_wav.file.read())
|
| 71 |
|
| 72 |
try:
|
| 73 |
+
with wave.open(speaker_wav_filename, "r") as temper:
|
| 74 |
pass
|
| 75 |
except:
|
| 76 |
return JSONResponse({"comment" : "Audio file format not supported."}, status_code = 422)
|