Update app.py
Browse filesUpdate to recognise all thre quote mark
# Split the text using straight quotes (") and curly quotes (“ and ”)
paragraphs = [p.strip() for p in re.split(r'[“”"]', text) if p.strip()]
app.py
CHANGED
|
@@ -130,7 +130,9 @@ async def text_to_speech(text, voice, rate, pitch):
|
|
| 130 |
if not voice:
|
| 131 |
return None, gr.Warning("Please select a voice.")
|
| 132 |
|
| 133 |
-
paragraphs = [p.strip() for p in re.split(r'"', text) if p.strip()]
|
|
|
|
|
|
|
| 134 |
final_audio_segments = []
|
| 135 |
|
| 136 |
for paragraph in paragraphs:
|
|
|
|
| 130 |
if not voice:
|
| 131 |
return None, gr.Warning("Please select a voice.")
|
| 132 |
|
| 133 |
+
#paragraphs = [p.strip() for p in re.split(r'"', text) if p.strip()]
|
| 134 |
+
# Split the text using straight quotes (") and curly quotes (“ and ”)
|
| 135 |
+
paragraphs = [p.strip() for p in re.split(r'[“”"]', text) if p.strip()]
|
| 136 |
final_audio_segments = []
|
| 137 |
|
| 138 |
for paragraph in paragraphs:
|