cnph001 commited on
Commit
e4e3d3e
·
verified ·
1 Parent(s): 40b1902

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -7,8 +7,7 @@ import os
7
  import re # Import the regular expression module
8
  from pathlib import Path
9
 
10
- # At the top of your file:
11
- SILENCE_PATH = Path(__file__).parent.absolute() / "Silence.mp3"
12
 
13
  # Get all available voices
14
  async def get_voices():
@@ -34,6 +33,10 @@ async def paragraph_to_speech(text, voice, rate, pitch):
34
  parts = re.split(r'(SS\d+\.?\d*)', text)
35
  for part in parts:
36
  if re.match(r'SS\d+\.?\d*', part):
 
 
 
 
37
  if SILENCE_PATH.exists():
38
  audio_segments.append(str(SILENCE_PATH))
39
  print(f"Silence added at {SILENCE_PATH}")
 
7
  import re # Import the regular expression module
8
  from pathlib import Path
9
 
10
+
 
11
 
12
  # Get all available voices
13
  async def get_voices():
 
33
  parts = re.split(r'(SS\d+\.?\d*)', text)
34
  for part in parts:
35
  if re.match(r'SS\d+\.?\d*', part):
36
+ # At the top of your file:
37
+ #SILENCE_PATH = Path(__file__).parent.absolute() / "Silence.mp3"
38
+ # At the top of your file:
39
+ SILENCE_PATH = Path(__file__).parent.absolute() / "static" / "intro.mp3"
40
  if SILENCE_PATH.exists():
41
  audio_segments.append(str(SILENCE_PATH))
42
  print(f"Silence added at {SILENCE_PATH}")