cnph001 commited on
Commit
f5bf582
·
verified ·
1 Parent(s): 40b007d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
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."""