updates the voices list
Browse files
App/TTS/utils/Descript.py
CHANGED
@@ -180,7 +180,10 @@ class DescriptTTS:
|
|
180 |
url = "https://api.descript.com/v2/users/me/voices"
|
181 |
try:
|
182 |
response = await self.make_authenticated_request(url)
|
183 |
-
|
|
|
|
|
|
|
184 |
except Exception as e:
|
185 |
print(f"Failed to fetch voices: {e}")
|
186 |
return None
|
@@ -364,10 +367,3 @@ class DescriptTTS:
|
|
364 |
return path, url
|
365 |
|
366 |
|
367 |
-
# async def example_usage():
|
368 |
-
# descript_tts = DescriptTTS()
|
369 |
-
# r=await descript_tts.say('Watch the world burn')
|
370 |
-
# print(r)
|
371 |
-
|
372 |
-
# # Run the example usage asynchronously
|
373 |
-
# asyncio.run(example_usage())
|
|
|
180 |
url = "https://api.descript.com/v2/users/me/voices"
|
181 |
try:
|
182 |
response = await self.make_authenticated_request(url)
|
183 |
+
voices = response
|
184 |
+
self.voice_ids = {voice['name']: voice['id'] for voice in voices}
|
185 |
+
|
186 |
+
return voices
|
187 |
except Exception as e:
|
188 |
print(f"Failed to fetch voices: {e}")
|
189 |
return None
|
|
|
367 |
return path, url
|
368 |
|
369 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|