Commit
•
dd0d35a
1
Parent(s):
dcdafa6
Update app.py
Browse files
app.py
CHANGED
@@ -126,9 +126,9 @@ def longread(input_file,sdp_ratio, noise_scale, noise_scale_w, length_scale):
|
|
126 |
current_paragraph = ''
|
127 |
for match in matches:
|
128 |
sentence_with_delimiter = match.group(0)
|
129 |
-
if len(current_paragraph) + len(sentence_with_delimiter) <
|
130 |
current_paragraph += sentence_with_delimiter
|
131 |
-
elif len(current_paragraph) + len(sentence_with_delimiter) <=
|
132 |
current_paragraph += sentence_with_delimiter
|
133 |
paragraphs.append(current_paragraph.strip())
|
134 |
current_paragraph = ''
|
@@ -147,7 +147,7 @@ def longread(input_file,sdp_ratio, noise_scale, noise_scale_w, length_scale):
|
|
147 |
output_filename = f"out/{cnt}.wav"
|
148 |
write(output_filename, 44100, audio_output.astype(np.float32))
|
149 |
input_file = f"out/{cnt}.wav"
|
150 |
-
pause_duration =
|
151 |
try:
|
152 |
audio_segment = AudioSegment.from_wav(input_file)
|
153 |
if len(output_audio) > 0:
|
|
|
126 |
current_paragraph = ''
|
127 |
for match in matches:
|
128 |
sentence_with_delimiter = match.group(0)
|
129 |
+
if len(current_paragraph) + len(sentence_with_delimiter) < 60:
|
130 |
current_paragraph += sentence_with_delimiter
|
131 |
+
elif len(current_paragraph) + len(sentence_with_delimiter) <= 110:
|
132 |
current_paragraph += sentence_with_delimiter
|
133 |
paragraphs.append(current_paragraph.strip())
|
134 |
current_paragraph = ''
|
|
|
147 |
output_filename = f"out/{cnt}.wav"
|
148 |
write(output_filename, 44100, audio_output.astype(np.float32))
|
149 |
input_file = f"out/{cnt}.wav"
|
150 |
+
pause_duration = 15
|
151 |
try:
|
152 |
audio_segment = AudioSegment.from_wav(input_file)
|
153 |
if len(output_audio) > 0:
|