summaryrefslogtreecommitdiff
path: root/external/plyer/platforms/win/tts.py
diff options
context:
space:
mode:
Diffstat (limited to 'external/plyer/platforms/win/tts.py')
-rw-r--r--external/plyer/platforms/win/tts.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/external/plyer/platforms/win/tts.py b/external/plyer/platforms/win/tts.py
new file mode 100644
index 0000000..e2539c3
--- /dev/null
+++ b/external/plyer/platforms/win/tts.py
@@ -0,0 +1,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()