Package synthDrivers :: Module audiologic
[hide private]
[frames] | no frames]

Source Code for Module synthDrivers.audiologic

 1  #synthDrivers/audiologic.py 
 2  #A part of NonVisual Desktop Access (NVDA) 
 3  #This file is covered by the GNU General Public License. 
 4  #See the file COPYING for more details. 
 5  #Copyright (C) 2008-2010 Gianluca Casalino <gianluca@spazioausili.net>, James Teh <jamie@jantrid.net> 
 6   
 7  from collections import OrderedDict 
 8  import _audiologic 
 9  from synthDriverHandler import SynthDriver 
10  import _winreg 
11 12 -class SynthDriver(SynthDriver):
13 supportedSettings=(SynthDriver.RateSetting(),SynthDriver.PitchSetting(minStep=5),SynthDriver.InflectionSetting(minStep=10),SynthDriver.VolumeSetting(minStep=2)) 14 15 description="Audiologic Tts3" 16 name="audiologic" 17 18 19 @classmethod
20 - def check(cls):
21 try: 22 r=_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,"SOFTWARE\Audiologic\Sintesi Audiologic") 23 r.Close() 24 return True 25 except: 26 return False
27
28 - def __init__(self):
30
31 - def terminate(self):
33
34 - def speakText(self,text,index=None):
35 if isinstance(index,int) and index>=0: 36 text="[:BMK=%d]%s"%(index,text) 37 _audiologic.TtsSpeak(text)
38
39 - def _get_lastIndex(self):
41
42 - def cancel(self):
44
45 - def _getAvailableVoices(self):
46 return OrderedDict(("",synthDriverHandler.VoiceInfo("", "Tts3",language="it")))
47
48 - def _get_voice(self):
49 return ""
50
51 - def _set_voice(self, voice):
52 pass
53
54 - def _get_rate(self):
56
57 - def _set_rate(self,value):
59
60 - def _get_pitch(self):
62
63 - def _set_pitch(self,value):
65
66 - def _get_volume(self):
68
69 - def _set_volume(self,value):
71
72 - def _get_inflection(self):
73 return _audiologic.TtsGetProsody('Expression') *10
74
75 - def _set_inflection(self,value):
77
78 - def pause(self,switch):
79 if switch: 80 _audiologic.TtsPause() 81 else: 82 _audiologic.TtsRestart()
83