Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -297,7 +297,6 @@ def analyse(files):
|
|
| 297 |
async def _edge_speak(text, path, voice):
|
| 298 |
await edge_tts.Communicate(text, voice).save(path)
|
| 299 |
|
| 300 |
-
|
| 301 |
def _split_chunks(text, chunk_size=1500):
|
| 302 |
text = re.sub(r"[=\-]{2,}|\[.*?\]|[#*`]", " ", text)
|
| 303 |
text = re.sub(r"\s+", " ", text).strip()
|
|
@@ -312,7 +311,6 @@ def _split_chunks(text, chunk_size=1500):
|
|
| 312 |
if cur: chunks.append(cur)
|
| 313 |
return chunks or [text[:chunk_size]]
|
| 314 |
|
| 315 |
-
|
| 316 |
def _build_audio(mp3files, speed=1.0, pitch=1.0):
|
| 317 |
if not mp3files or AudioSegment is None:
|
| 318 |
return None
|
|
@@ -395,7 +393,6 @@ def text_to_speech_full(text, speed=1.0, pitch=1.0):
|
|
| 395 |
return _build_audio(files, speed, pitch)
|
| 396 |
return None
|
| 397 |
|
| 398 |
-
|
| 399 |
def make_audio(text, speed=1.0, pitch=1.0):
|
| 400 |
return text_to_speech_full(text, speed, pitch)
|
| 401 |
|
|
|
|
| 297 |
async def _edge_speak(text, path, voice):
|
| 298 |
await edge_tts.Communicate(text, voice).save(path)
|
| 299 |
|
|
|
|
| 300 |
def _split_chunks(text, chunk_size=1500):
|
| 301 |
text = re.sub(r"[=\-]{2,}|\[.*?\]|[#*`]", " ", text)
|
| 302 |
text = re.sub(r"\s+", " ", text).strip()
|
|
|
|
| 311 |
if cur: chunks.append(cur)
|
| 312 |
return chunks or [text[:chunk_size]]
|
| 313 |
|
|
|
|
| 314 |
def _build_audio(mp3files, speed=1.0, pitch=1.0):
|
| 315 |
if not mp3files or AudioSegment is None:
|
| 316 |
return None
|
|
|
|
| 393 |
return _build_audio(files, speed, pitch)
|
| 394 |
return None
|
| 395 |
|
|
|
|
| 396 |
def make_audio(text, speed=1.0, pitch=1.0):
|
| 397 |
return text_to_speech_full(text, speed, pitch)
|
| 398 |
|