2022-09-16 10:07:57 -06:00
|
|
|
import subprocess
|
2024-06-02 10:31:58 -06:00
|
|
|
from sbapp.plyer.facades import TTS
|
|
|
|
from sbapp.plyer.utils import whereis_exe
|
2022-09-16 10:07:57 -06:00
|
|
|
|
|
|
|
|
|
|
|
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()
|