summaryrefslogtreecommitdiff
path: root/external/plyer/platforms/win/tts.py
blob: e2539c3e05442042f7fe09cb434522a37d46e07a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import subprocess
from plyer.facades import TTS
from plyer.utils import whereis_exe


class EspeakTextToSpeech(TTS):
    ''' Speaks using the espeak program
    '''
    def _speak(self, **kwargs):
        subprocess.call(["espeak", kwargs.get('message')])


def instance():
    if whereis_exe('espeak.exe'):
        return EspeakTextToSpeech()
    return TTS()