make soundicons case insensetive
This commit is contained in:
parent
2a9e8c4017
commit
dee137f5c6
@ -26,17 +26,17 @@ class outputManager():
|
|||||||
|
|
||||||
def speakText(self, environment, text, interrupt=True):
|
def speakText(self, environment, text, interrupt=True):
|
||||||
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'enabled'):
|
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'enabled'):
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,"INFO speech disabled in outputManager.speakText",debug.debugLevel.INFO)
|
environment['runtime']['debug'].writeDebugOut(environment,"Speech disabled in outputManager.speakText",debug.debugLevel.INFO)
|
||||||
return
|
return
|
||||||
if environment['runtime']['speechDriver'] == None:
|
if environment['runtime']['speechDriver'] == None:
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,"Error no speechDriver in outputManager.speakText",debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,"No speechDriver in outputManager.speakText",debug.debugLevel.ERROR)
|
||||||
return
|
return
|
||||||
if interrupt:
|
if interrupt:
|
||||||
self.interruptOutput(environment)
|
self.interruptOutput(environment)
|
||||||
try:
|
try:
|
||||||
environment['runtime']['speechDriver'].setLanguage(environment['runtime']['settingsManager'].getSetting(environment, 'speech', 'language'))
|
environment['runtime']['speechDriver'].setLanguage(environment['runtime']['settingsManager'].getSetting(environment, 'speech', 'language'))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,"Error while setting speech language in outputManager.speakText",debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,"setting speech language in outputManager.speakText",debug.debugLevel.ERROR)
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -48,31 +48,31 @@ class outputManager():
|
|||||||
try:
|
try:
|
||||||
environment['runtime']['speechDriver'].setPitch(environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'speech', 'pitch'))
|
environment['runtime']['speechDriver'].setPitch(environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'speech', 'pitch'))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,"Error while setting speech pitch in outputManager.speakText",debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,"setting speech pitch in outputManager.speakText",debug.debugLevel.ERROR)
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
environment['runtime']['speechDriver'].setRate(environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'speech', 'rate'))
|
environment['runtime']['speechDriver'].setRate(environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'speech', 'rate'))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,"Error while setting speech rate in outputManager.speakText",debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,"setting speech rate in outputManager.speakText",debug.debugLevel.ERROR)
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
environment['runtime']['speechDriver'].setModule(environment['runtime']['settingsManager'].getSetting(environment, 'speech', 'module'))
|
environment['runtime']['speechDriver'].setModule(environment['runtime']['settingsManager'].getSetting(environment, 'speech', 'module'))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,"Error while setting speech module in outputManager.speakText",debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,"setting speech module in outputManager.speakText",debug.debugLevel.ERROR)
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
environment['runtime']['speechDriver'].setVolume(environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'speech', 'volume'))
|
environment['runtime']['speechDriver'].setVolume(environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'speech', 'volume'))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,"Error while setting speech volume in outputManager.speakText ",debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,"setting speech volume in outputManager.speakText ",debug.debugLevel.ERROR)
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
environment['runtime']['speechDriver'].speak(text)
|
environment['runtime']['speechDriver'].speak(text)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,"Error while \"speak\" in outputManager.speakText ",debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,"\"speak\" in outputManager.speakText ",debug.debugLevel.ERROR)
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
||||||
|
|
||||||
def brailleText(self, environment, text, interrupt=True):
|
def brailleText(self, environment, text, interrupt=True):
|
||||||
@ -88,18 +88,19 @@ class outputManager():
|
|||||||
def playSoundIcon(self, environment, soundIcon = '', interrupt=True):
|
def playSoundIcon(self, environment, soundIcon = '', interrupt=True):
|
||||||
if soundIcon == '':
|
if soundIcon == '':
|
||||||
return False
|
return False
|
||||||
|
soundIcon = soundIcon.upper()
|
||||||
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'):
|
if not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'):
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,"INFO sound disabled in outputManager.speakText",debug.debugLevel.INFO)
|
environment['runtime']['debug'].writeDebugOut(environment,"Sound disabled in outputManager.speakText",debug.debugLevel.INFO)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if environment['runtime']['soundDriver'] == None:
|
if environment['runtime']['soundDriver'] == None:
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,"Error no speechDriver in outputManager.speakText",debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,"No speechDriver in outputManager.speakText",debug.debugLevel.ERROR)
|
||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
environment['runtime']['soundDriver'].setVolume(environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'sound', 'volume'))
|
environment['runtime']['soundDriver'].setVolume(environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'sound', 'volume'))
|
||||||
environment['runtime']['soundDriver'].playSoundFile(environment['soundIcons'][soundIcon], interrupt)
|
environment['runtime']['soundDriver'].playSoundFile(environment['soundIcons'][soundIcon], interrupt)
|
||||||
return True
|
return True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,"Error while \"playSoundIcon\" in outputManager.speakText ",debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,"\"playSoundIcon\" in outputManager.speakText ",debug.debugLevel.ERROR)
|
||||||
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
||||||
return False
|
return False
|
||||||
|
@ -61,7 +61,7 @@ class settingsManager():
|
|||||||
if line.count("=") != 1:
|
if line.count("=") != 1:
|
||||||
continue
|
continue
|
||||||
Values = line.split('=')
|
Values = line.split('=')
|
||||||
soundIcon = Values[0]
|
soundIcon = Values[0].upper()
|
||||||
Values[1] = Values[1].replace("'","")
|
Values[1] = Values[1].replace("'","")
|
||||||
Values[1] = Values[1].replace('"',"")
|
Values[1] = Values[1].replace('"',"")
|
||||||
soundIconFile = ''
|
soundIconFile = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user