Update app.py
Browse files
app.py
CHANGED
@@ -57,7 +57,6 @@ async def paragraph_to_speech(text, voice, rate, pitch):
|
|
57 |
silence_durations = []
|
58 |
parts = re.split(r'(SS\d+\.?\d*)', text)
|
59 |
for part in parts:
|
60 |
-
silence_duration = float(part[2:]) * 1000 # Convert to milliseconds
|
61 |
if re.match(r'SS\d+\.?\d*', part):
|
62 |
# At the top of your file:
|
63 |
#SILENCE_PATH = Path(__file__).parent.absolute() / "Silence.mp3"
|
@@ -69,6 +68,7 @@ async def paragraph_to_speech(text, voice, rate, pitch):
|
|
69 |
# audio_segments.append(str(SILENCE_PATH))
|
70 |
# print(f"Silence.mp3 file found at {SILENCE_PATH} and is inserted")
|
71 |
#else:
|
|
|
72 |
print(f"Silence.mp3 file NOT FOUND")
|
73 |
silence_file_path = get_silence(silence_duration) # Store the returned filename
|
74 |
audio_segments.append(silence_file_path) # Use the stored filename
|
|
|
57 |
silence_durations = []
|
58 |
parts = re.split(r'(SS\d+\.?\d*)', text)
|
59 |
for part in parts:
|
|
|
60 |
if re.match(r'SS\d+\.?\d*', part):
|
61 |
# At the top of your file:
|
62 |
#SILENCE_PATH = Path(__file__).parent.absolute() / "Silence.mp3"
|
|
|
68 |
# audio_segments.append(str(SILENCE_PATH))
|
69 |
# print(f"Silence.mp3 file found at {SILENCE_PATH} and is inserted")
|
70 |
#else:
|
71 |
+
silence_duration = float(part[2:]) * 1000 # Convert to milliseconds
|
72 |
print(f"Silence.mp3 file NOT FOUND")
|
73 |
silence_file_path = get_silence(silence_duration) # Store the returned filename
|
74 |
audio_segments.append(silence_file_path) # Use the stored filename
|