Error JSON updated. Remove silence default set to True
Browse files- handler.py +9 -3
handler.py
CHANGED
|
@@ -36,14 +36,20 @@ class EndpointHandler:
|
|
| 36 |
try:
|
| 37 |
ref_audio_path = data.get("ref_audio")
|
| 38 |
if not ref_audio_path:
|
| 39 |
-
return {
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
ref_text = data.get("ref_text", "")
|
| 42 |
gen_text = data.get("gen_text", "")
|
| 43 |
if not gen_text:
|
| 44 |
-
return {
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
remove_silence = data.get("remove_silence",
|
| 47 |
cross_fade_duration = data.get("cross_fade_duration", 0.15)
|
| 48 |
speed = data.get("speed", 1.0)
|
| 49 |
|
|
|
|
| 36 |
try:
|
| 37 |
ref_audio_path = data.get("ref_audio")
|
| 38 |
if not ref_audio_path:
|
| 39 |
+
return {
|
| 40 |
+
"success": False,
|
| 41 |
+
"error": "Missing required field: 'ref_audio'"
|
| 42 |
+
}
|
| 43 |
|
| 44 |
ref_text = data.get("ref_text", "")
|
| 45 |
gen_text = data.get("gen_text", "")
|
| 46 |
if not gen_text:
|
| 47 |
+
return {
|
| 48 |
+
"success": False,
|
| 49 |
+
"error": "Missing required field: 'gen_text'"
|
| 50 |
+
}
|
| 51 |
|
| 52 |
+
remove_silence = data.get("remove_silence", True)
|
| 53 |
cross_fade_duration = data.get("cross_fade_duration", 0.15)
|
| 54 |
speed = data.get("speed", 1.0)
|
| 55 |
|