30 lines
605 B
Python
Raw Normal View History

2016-04-05 12:44:35 -05:00
from __future__ import absolute_import
import ctypes
from .base import Output
2016-02-13 17:06:36 -06:00
class SystemAccess (Output):
"""Supports System Access and System Access Mobile"""
name = "System Access"
lib32 = 'saapi32.dll'
2016-04-05 12:44:35 -05:00
argtypes = {
'SA_BrlShowTextW': (ctypes.c_wchar_p,),
'SA_SayW': (ctypes.c_wchar_p,),
}
2016-02-13 17:06:36 -06:00
priority = 99
def braille(self, text, **options):
2016-04-05 12:44:35 -05:00
self.lib.SA_BrlShowTextW(text)
2016-02-13 17:06:36 -06:00
def speak(self, text, interrupt=False):
if self.is_active():
2016-04-05 12:44:35 -05:00
self.dll.SA_SayW(str(text))
2016-02-13 17:06:36 -06:00
def is_active(self):
try:
return self.dll.SA_IsRunning()
except:
return False
output_class = SystemAccess