Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,15 +64,9 @@ async def get_voices():
|
|
| 64 |
|
| 65 |
|
| 66 |
## EDIT
|
| 67 |
-
import re
|
| 68 |
-
import tempfile
|
| 69 |
-
from pydub import AudioSegment
|
| 70 |
-
import asyncio
|
| 71 |
-
|
| 72 |
-
|
| 73 |
async def generate_audio_with_voice_prefix(text_segment, default_voice, rate, pitch):
|
| 74 |
"""Generates audio for a text segment, handling permanent and temporary voice changes."""
|
| 75 |
-
|
| 76 |
# Define the voice map for reference
|
| 77 |
voice_map = {
|
| 78 |
"1F": ("en-GB-SoniaNeural", 25, 0),
|
|
@@ -166,7 +160,6 @@ async def generate_audio_with_voice_prefix(text_segment, default_voice, rate, pi
|
|
| 166 |
await asyncio.sleep(0.5) # Retry after brief pause
|
| 167 |
|
| 168 |
return None
|
| 169 |
-
|
| 170 |
### END EDIT
|
| 171 |
|
| 172 |
async def process_transcript_line(line, default_voice, rate, pitch):
|
|
|
|
| 64 |
|
| 65 |
|
| 66 |
## EDIT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
async def generate_audio_with_voice_prefix(text_segment, default_voice, rate, pitch):
|
| 68 |
"""Generates audio for a text segment, handling permanent and temporary voice changes."""
|
| 69 |
+
|
| 70 |
# Define the voice map for reference
|
| 71 |
voice_map = {
|
| 72 |
"1F": ("en-GB-SoniaNeural", 25, 0),
|
|
|
|
| 160 |
await asyncio.sleep(0.5) # Retry after brief pause
|
| 161 |
|
| 162 |
return None
|
|
|
|
| 163 |
### END EDIT
|
| 164 |
|
| 165 |
async def process_transcript_line(line, default_voice, rate, pitch):
|