Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -619,8 +619,8 @@ def lang_detector(text):
|
|
619 |
return f"ERROR:{str(e)}"
|
620 |
|
621 |
def trim_text(text,language):
|
622 |
-
limit_cj =
|
623 |
-
limit_en =
|
624 |
search_limit_cj = limit_cj+30
|
625 |
search_limit_en = limit_en +30
|
626 |
text = text.replace('\n', '').strip()
|
@@ -655,7 +655,7 @@ def duration(audio_file_path):
|
|
655 |
return False
|
656 |
try:
|
657 |
audio_duration = librosa.get_duration(filename=audio_file_path)
|
658 |
-
if not
|
659 |
wprint("The audio length must be between 3~10 seconds/音频时长须在3~10秒之间")
|
660 |
return False
|
661 |
return True
|
|
|
619 |
return f"ERROR:{str(e)}"
|
620 |
|
621 |
def trim_text(text,language):
|
622 |
+
limit_cj = 20000 #character
|
623 |
+
limit_en = 20000 #words
|
624 |
search_limit_cj = limit_cj+30
|
625 |
search_limit_en = limit_en +30
|
626 |
text = text.replace('\n', '').strip()
|
|
|
655 |
return False
|
656 |
try:
|
657 |
audio_duration = librosa.get_duration(filename=audio_file_path)
|
658 |
+
if not 1 < audio_duration < 60:
|
659 |
wprint("The audio length must be between 3~10 seconds/音频时长须在3~10秒之间")
|
660 |
return False
|
661 |
return True
|