Vo Hoang Minh commited on
Commit ·
bfe0a20
1
Parent(s): fbb92b9
up
Browse files- pkg/tts_run.py +2 -1
pkg/tts_run.py
CHANGED
|
@@ -225,7 +225,8 @@ def speech(text, voice, rate, pitch, webhook=None):
|
|
| 225 |
with open(nm, "rb") as f:
|
| 226 |
u = uppath(basename(nm))
|
| 227 |
print('upload to:', u)
|
| 228 |
-
|
|
|
|
| 229 |
r.raise_for_status()
|
| 230 |
|
| 231 |
|
|
|
|
| 225 |
with open(nm, "rb") as f:
|
| 226 |
u = uppath(basename(nm))
|
| 227 |
print('upload to:', u)
|
| 228 |
+
mime = "audio/mpeg" if nm.endswith(".mp3") else "text/plain"
|
| 229 |
+
r = requests.put(u, data=f, headers={"Content-Type": mime})
|
| 230 |
r.raise_for_status()
|
| 231 |
|
| 232 |
|