Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,12 @@ import re
|
|
| 8 |
import struct
|
| 9 |
import wave
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
# Function to create a temporary silent WAV file
|
| 12 |
def create_silent_wav(duration, temp_dir, sample_rate=44100, num_channels=1, sample_width=2):
|
| 13 |
"""Creates a temporary WAV file containing silence."""
|
|
|
|
| 8 |
import struct
|
| 9 |
import wave
|
| 10 |
|
| 11 |
+
# Define the get_voices function first
|
| 12 |
+
async def get_voices():
|
| 13 |
+
voices_list = await edge_tts.list_voices()
|
| 14 |
+
voices_dict = {v["ShortName"]: f"{v['Name']} - {v['LocaleName']} ({v['Gender']})" for v in voices_list}
|
| 15 |
+
return voices_dict
|
| 16 |
+
|
| 17 |
# Function to create a temporary silent WAV file
|
| 18 |
def create_silent_wav(duration, temp_dir, sample_rate=44100, num_channels=1, sample_width=2):
|
| 19 |
"""Creates a temporary WAV file containing silence."""
|