Update handler.py
Browse files- handler.py +10 -3
handler.py
CHANGED
|
@@ -40,6 +40,13 @@ class EndpointHandler():
|
|
| 40 |
except FileNotFoundError:
|
| 41 |
pass
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
except FileNotFoundError:
|
| 41 |
pass
|
| 42 |
|
| 43 |
+
from flask import Response
|
| 44 |
+
buffer.seek(0)
|
| 45 |
+
return Response(
|
| 46 |
+
buffer.read(),
|
| 47 |
+
mimetype='audio/wav',
|
| 48 |
+
headers={
|
| 49 |
+
'Content-Disposition': 'attachment; filename=output.wav',
|
| 50 |
+
'Content-Type': 'audio/wav'
|
| 51 |
+
}
|
| 52 |
+
)
|