Skip to content

Commit e7ffcf4

Browse files
committed
fixed: async scandir finding voices
1 parent 89bec47 commit e7ffcf4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

api/src/services/tts_service.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,15 @@ async def combine_voices(self, voices: List[str]) -> str:
252252
if not isinstance(e, (ValueError, RuntimeError)):
253253
raise RuntimeError(f"Error combining voices: {str(e)}")
254254
raise
255-
255+
256256
async def list_voices(self) -> List[str]:
257257
"""List all available voices"""
258258
voices = []
259259
try:
260-
async with aiofiles.scandir(TTSModel.VOICES_DIR) as it:
261-
async for entry in it:
262-
if entry.name.endswith(".pt"):
263-
voices.append(entry.name[:-3]) # Remove .pt extension
260+
it = await aiofiles.os.scandir(TTSModel.VOICES_DIR)
261+
for entry in it:
262+
if entry.name.endswith(".pt"):
263+
voices.append(entry.name[:-3]) # Remove .pt extension
264264
except Exception as e:
265265
logger.error(f"Error listing voices: {str(e)}")
266266
return sorted(voices)

0 commit comments

Comments
 (0)