mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-08-26 18:09:21 +00:00
Putting all the code from the current master branch of TWBlue
This commit is contained in:
19
src/accessible_output2/outputs/pc_talker.py
Normal file
19
src/accessible_output2/outputs/pc_talker.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import ctypes
|
||||
from base import Output
|
||||
|
||||
class PCTalker(Output):
|
||||
lib32 = 'pctkusr.dll'
|
||||
lib64 = 'pctkusr64.dll'
|
||||
|
||||
def speak(self, text, interrupt=False):
|
||||
if interrupt:
|
||||
self.silence()
|
||||
self.lib.PCTKPRead(text.encode('cp932', 'replace'))
|
||||
|
||||
def silence(self):
|
||||
self.lib.PCTKVReset()
|
||||
|
||||
def is_active(self):
|
||||
return self.lib.PCTKStatus() != 0
|
||||
|
||||
output_class = PCTalker
|
Reference in New Issue
Block a user