File size: 464 Bytes
cf72e88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import sys

import edge_tts


class VoicesManager:
    @staticmethod
    async def create():
        return await edge_tts.VoicesManager.create()

    @staticmethod
    def find(voices, Gender, Locale):
        voices = voices.find(Gender=Gender, Locale=Locale)
        if len(voices) == 0:
            print(f"Specified TTS language not found. Make sure you are using the correct format. For example: en-US")
            sys.exit(1)
        return voices['Name']