Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,10 +12,13 @@ if DEVICE == "auto":
|
|
| 12 |
print(f"[SYSTEM] | Using {DEVICE} type compute device.")
|
| 13 |
|
| 14 |
# Variables
|
|
|
|
| 15 |
CHAR_LIMIT = 2000
|
|
|
|
| 16 |
DEFAULT_INPUT = ""
|
| 17 |
DEFAULT_VOICE = "af_heart"
|
| 18 |
|
|
|
|
| 19 |
CHOICES = {
|
| 20 |
"🇺🇸 🚺 Heart ❤️": "af_heart",
|
| 21 |
"🇺🇸 🚺 Bella 🔥": "af_bella",
|
|
@@ -65,7 +68,7 @@ footer {
|
|
| 65 |
'''
|
| 66 |
|
| 67 |
# Functions
|
| 68 |
-
def trim_silence(audio, threshold=
|
| 69 |
abs_audio = np.abs(audio)
|
| 70 |
indices = np.where(abs_audio > threshold)[0]
|
| 71 |
|
|
|
|
| 12 |
print(f"[SYSTEM] | Using {DEVICE} type compute device.")
|
| 13 |
|
| 14 |
# Variables
|
| 15 |
+
SILENT_THRESHOLD = 0.1
|
| 16 |
CHAR_LIMIT = 2000
|
| 17 |
+
|
| 18 |
DEFAULT_INPUT = ""
|
| 19 |
DEFAULT_VOICE = "af_heart"
|
| 20 |
|
| 21 |
+
|
| 22 |
CHOICES = {
|
| 23 |
"🇺🇸 🚺 Heart ❤️": "af_heart",
|
| 24 |
"🇺🇸 🚺 Bella 🔥": "af_bella",
|
|
|
|
| 68 |
'''
|
| 69 |
|
| 70 |
# Functions
|
| 71 |
+
def trim_silence(audio, threshold=SILENT_THRESHOLD):
|
| 72 |
abs_audio = np.abs(audio)
|
| 73 |
indices = np.where(abs_audio > threshold)[0]
|
| 74 |
|