MCPcopy Create free account
hub / github.com/ActiveState/code / __init__

Method __init__

recipes/Python/167487_Windows_SAPI4/recipe-167487.py:18–38  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

16 voice_list = []
17
18 def __init__(self):
19 #init
20 self.SpeedPercent=StringVar()
21 self.PitchPercent=StringVar()
22 self.VolumeLeftPercent=StringVar()
23 self.VolumeRightPercent=StringVar()
24
25 try:
26 self.directss = win32com.client.DispatchWithEvents("{EEE78591-FE22-11D0-8BEF-0060081841DE}", Sapi4Events)
27 voice_no = self.directss.Find(0)
28 print 'Woohoo: have found engine'
29 self.voice = self.directss.Select(voice_no)
30 voice_name = self.directss.ModeName(voice_no)
31 self.sapi_compliant = 1
32 if len(self.voice_list) < 1:
33 self.getVoiceList()
34 self.selectVoice(voice_name)
35 except:
36 print 'Bugger: unable to initialise speech!'
37 #self.quit()
38 return None
39
40 def selectVoice(self, voice_name=''):
41 #select voice

Callers

nothing calls this directly

Calls 3

getVoiceListMethod · 0.95
selectVoiceMethod · 0.95
SelectMethod · 0.80

Tested by

no test coverage detected