add commands {inc,dec}_{speech,sound}_{volume,rate,pitch}
This commit is contained in:
22
src/fenrir-package/commands/commands/dec_sound_volume.py
Normal file
22
src/fenrir-package/commands/commands/dec_sound_volume.py
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/python
|
||||
import math
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def run(self, environment):
|
||||
|
||||
value = environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'sound', 'volume')
|
||||
|
||||
value = round((math.ceil(20 * value) / 20) - 0.1, 2)
|
||||
if value < 0.1:
|
||||
value = 0.1
|
||||
environment = environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'volume', str(value))
|
||||
|
||||
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent sound volume", soundIcon='SoundOff', interrupt=True)
|
||||
|
||||
return environment
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
def shutdown(self):
|
||||
pass
|
22
src/fenrir-package/commands/commands/dec_speech_pitch.py
Normal file
22
src/fenrir-package/commands/commands/dec_speech_pitch.py
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/python
|
||||
import math
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def run(self, environment):
|
||||
|
||||
value = environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'speech', 'pitch')
|
||||
|
||||
value = round((math.ceil(20 * value) / 20) - 0.1, 2)
|
||||
if value < 0.0:
|
||||
value = 0.0
|
||||
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'pitch', str(value))
|
||||
|
||||
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech pitch", soundIcon='SpeechOff', interrupt=True)
|
||||
|
||||
return environment
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
def shutdown(self):
|
||||
pass
|
22
src/fenrir-package/commands/commands/dec_speech_rate.py
Normal file
22
src/fenrir-package/commands/commands/dec_speech_rate.py
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/python
|
||||
import math
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def run(self, environment):
|
||||
|
||||
value = environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'speech', 'rate')
|
||||
|
||||
value = round((math.ceil(20 * value) / 20) - 0.1, 2)
|
||||
if value < 0.0:
|
||||
value = 0.0
|
||||
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'rate', str(value))
|
||||
|
||||
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech rate", soundIcon='SpeechOff', interrupt=True)
|
||||
|
||||
return environment
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
def shutdown(self):
|
||||
pass
|
22
src/fenrir-package/commands/commands/dec_speech_volume.py
Normal file
22
src/fenrir-package/commands/commands/dec_speech_volume.py
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/python
|
||||
import math
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def run(self, environment):
|
||||
|
||||
value = environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'speech', 'volume')
|
||||
|
||||
value = round((math.ceil(20 * value) / 20) - 0.1, 2)
|
||||
if value < 0.1:
|
||||
value = 0.1
|
||||
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'volume', str(value))
|
||||
|
||||
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech volume", soundIcon='SpeechOff', interrupt=True)
|
||||
|
||||
return environment
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
def shutdown(self):
|
||||
pass
|
22
src/fenrir-package/commands/commands/inc_sound_volume.py
Normal file
22
src/fenrir-package/commands/commands/inc_sound_volume.py
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/python
|
||||
import math
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def run(self, environment):
|
||||
|
||||
value = environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'sound', 'volume')
|
||||
|
||||
value = round((math.ceil(20 * value) / 20) + 0.1, 2)
|
||||
if value > 1.0:
|
||||
value = 1.0
|
||||
environment = environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'volume', str(value))
|
||||
|
||||
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent sound volume", soundIcon='SoundOn', interrupt=True)
|
||||
|
||||
return environment
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
def shutdown(self):
|
||||
pass
|
22
src/fenrir-package/commands/commands/inc_speech_pitch.py
Normal file
22
src/fenrir-package/commands/commands/inc_speech_pitch.py
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/python
|
||||
import math
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def run(self, environment):
|
||||
|
||||
value = environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'speech', 'pitch')
|
||||
|
||||
value = round((math.ceil(20 * value) / 20) + 0.1, 2)
|
||||
if value > 1.0:
|
||||
value = 1.0
|
||||
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'pitch', str(value))
|
||||
|
||||
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech pitch", soundIcon='SpeechOn', interrupt=True)
|
||||
|
||||
return environment
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
def shutdown(self):
|
||||
pass
|
22
src/fenrir-package/commands/commands/inc_speech_rate.py
Normal file
22
src/fenrir-package/commands/commands/inc_speech_rate.py
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/python
|
||||
import math
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def run(self, environment):
|
||||
|
||||
value = environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'speech', 'rate')
|
||||
|
||||
value = round((math.ceil(20 * value) / 20) + 0.1, 2)
|
||||
if value > 1.0:
|
||||
value = 1.0
|
||||
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'rate', str(value))
|
||||
|
||||
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech rate", soundIcon='SpeechOn', interrupt=True)
|
||||
|
||||
return environment
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
def shutdown(self):
|
||||
pass
|
22
src/fenrir-package/commands/commands/inc_speech_volume.py
Normal file
22
src/fenrir-package/commands/commands/inc_speech_volume.py
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/python
|
||||
import math
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def run(self, environment):
|
||||
|
||||
value = environment['runtime']['settingsManager'].getSettingAsFloat(environment, 'speech', 'volume')
|
||||
|
||||
value = round((math.ceil(20 * value) / 20) + 0.1, 2)
|
||||
if value > 1.0:
|
||||
value = 1.0
|
||||
environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'volume', str(value))
|
||||
|
||||
environment['runtime']['outputManager'].presentText(environment, str(int(value * 100)) + " percent speech volume", soundIcon='SpeechOn', interrupt=True)
|
||||
|
||||
return environment
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
def shutdown(self):
|
||||
pass
|
Reference in New Issue
Block a user