Spaces:
Sleeping
Sleeping
Upload 2 files
Browse filesAdd text clean feature
app.py
CHANGED
|
@@ -65,12 +65,12 @@ def estimate_text_duration(text):
|
|
| 65 |
if space_count / total_len < 0.1:
|
| 66 |
# Approx 300 chars per minute for Chinese
|
| 67 |
duration = total_len / 300
|
| 68 |
-
logger.
|
| 69 |
else:
|
| 70 |
# Approx 150 words per minute for English
|
| 71 |
word_count = len(text.split())
|
| 72 |
duration = word_count / 150
|
| 73 |
-
logger.
|
| 74 |
|
| 75 |
return duration
|
| 76 |
|
|
|
|
| 65 |
if space_count / total_len < 0.1:
|
| 66 |
# Approx 300 chars per minute for Chinese
|
| 67 |
duration = total_len / 300
|
| 68 |
+
# logger.debug(f"Estimated duration (char-based): {duration:.2f} min ({total_len} chars)")
|
| 69 |
else:
|
| 70 |
# Approx 150 words per minute for English
|
| 71 |
word_count = len(text.split())
|
| 72 |
duration = word_count / 150
|
| 73 |
+
# logger.debug(f"Estimated duration (word-based): {duration:.2f} min ({word_count} words)")
|
| 74 |
|
| 75 |
return duration
|
| 76 |
|