dont push

This commit is contained in:
chrys 2016-07-28 23:52:20 +02:00
parent 35a0dbd2fe
commit 6a117ac998
8 changed files with 44 additions and 17 deletions

View File

@ -1,23 +1,28 @@
[sound] [sound]
enabled=False, enabled=True
driver=sox driver=gstreamer
theme=default theme=default
[speech] [speech]
enabled=True enabled=True
driver=espeak #driver=espeak
rate=800 #language=en-us
#voice=en-us
driver=speechd
#rate=800
rate=50
volume=100
pitch=50 pitch=50
module=espeak module=espeak
voice=en-us voice=de
language=en-us language=de
volume=200
[braille] [braille]
enabled=False enabled=False
layout=en layout=en
[screen] ['screen]
driver=linux driver=linux
[keyboard] [keyboard]
@ -28,3 +33,4 @@ wordEcho=True
[general] [general]
debugLevel=0 debugLevel=0
punctuationLevel=1 punctuationLevel=1

Binary file not shown.

Binary file not shown.

View File

@ -12,8 +12,10 @@ class command():
if environment['screenData']['newDelta'] == environment['screenData']['oldDelta'] and \ if environment['screenData']['newDelta'] == environment['screenData']['oldDelta'] and \
not ttyChanged: not ttyChanged:
return environment return environment
if ttyChanged:
environment['runtime']['outputManager'].playSoundIcon(environment,'ChangeTTY')
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], ttyChanged) environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], ttyChanged)
return environment return environment
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -41,8 +41,9 @@ class outputManager():
if environment['runtime']['soundDriver'] == None: if environment['runtime']['soundDriver'] == None:
return return
print(soundIconName) print(soundIconName)
environment['runtime']['soundDriver'].playSoundFile( environment['soundIcons'][soundIconName], interrupt)
try: try:
print(environment['soundIcons'][soundIconName]) print(environment['soundIcons'][soundIconName])
environment['runtime']['soundDriver'].playSoundFile(environment, environment['soundIcons'][soundIconName], interrupt) environment['runtime']['soundDriver'].playSoundFile(environment['soundIcons'][soundIconName], interrupt)
except: except:
print('no icon there for' + IconName) print('no icon there for' + soundIconName)

View File

@ -86,16 +86,20 @@ class settingsManager():
Values[1] = Values[1].replace("'","") Values[1] = Values[1].replace("'","")
Values[1] = Values[1].replace('"',"") Values[1] = Values[1].replace('"',"")
validSoundIcon = False validSoundIcon = False
FilePath = ''
if os.path.exists(Values[1]): if os.path.exists(Values[1]):
FilePath = Values[1] FilePath = Values[1]
validKeyString = True validSoundIcon = True
else: else:
if not soundIconPath.endswith("/"):
soundIconPath += '/'
if os.path.exists(soundIconPath + Values[1]): if os.path.exists(soundIconPath + Values[1]):
FilePath = soundIconPath + Values[1] FilePath = soundIconPath + Values[1]
validSoundIcon = True validSoundIcon = True
if validSoundIcon: if validSoundIcon:
environment['soundIcons'][soundIcon] = FilePath environment['soundIcons'][soundIcon] = FilePath
siConfig.close() siConfig.close()
print(environment['soundIcons'])
return environment return environment
def loadSettings(self, environment, settingConfigPath='../../config/settings/settings.conf'): def loadSettings(self, environment, settingConfigPath='../../config/settings/settings.conf'):

View File

@ -0,0 +1,9 @@
#!/bin/python
import time
from sound.gstreamer import sound
s = sound()
s.playSoundFile('/home/chrys/Projekte/fenrir/fenrir/src/fenrir-package/1ChangeTTY.opus')
time.sleep(10)

View File

@ -1,4 +1,5 @@
import gi import gi
import time
from gi.repository import GLib from gi.repository import GLib
try: try:
@ -18,19 +19,23 @@ class sound:
return return
self.init() self.init()
def _onPlayerMessage(self, bus, message): def _onPlayerMessage(self, bus, message):
if message.type == Gst.MessageType.EOS: if message.type == Gst.MessageType.EOS:
self._player.set_state(Gst.State.NULL) self._player.set_state(Gst.State.NULL)
elif message.type == Gst.MessageType.ERROR: elif message.type == Gst.MessageType.ERROR:
self._player.set_state(Gst.State.NULL) self._player.set_state(Gst.State.NULL)
error, info = message.parse_error() error, info = message.parse_error()
print(error, info)
print('drin')
def _onPipelineMessage(self, bus, message): def _onPipelineMessage(self, bus, message):
if message.type == Gst.MessageType.EOS: if message.type == Gst.MessageType.EOS:
self._pipeline.set_state(Gst.State.NULL) self._pipeline.set_state(Gst.State.NULL)
elif message.type == Gst.MessageType.ERROR: elif message.type == Gst.MessageType.ERROR:
self._pipeline.set_state(Gst.State.NULL) self._pipeline.set_state(Gst.State.NULL)
error, info = message.parse_error() error, info = message.parse_error()
print(error, info)
print('drin')
def _onTimeout(self, element): def _onTimeout(self, element):
element.set_state(Gst.State.NULL) element.set_state(Gst.State.NULL)
@ -38,13 +43,13 @@ class sound:
def playSoundFile(self, fileName, interrupt=True): def playSoundFile(self, fileName, interrupt=True):
if interrupt: if interrupt:
self.stop() self.cancel()
self._player.set_property('uri', 'file://%s' % fileName) self._player.set_property('uri', 'file://%s' % fileName)
self._player.set_state(Gst.State.PLAYING) self._player.set_state(Gst.State.PLAYING)
def playFrequence(self, frequence, duration, adjustVolume, interrupt=True): def playFrequence(self, frequence, duration, adjustVolume, interrupt=True):
if interrupt: if interrupt:
self.stop() self.cancel()
self._source.set_property('volume', tone.volume) self._source.set_property('volume', tone.volume)
self._source.set_property('freq', tone.frequency) self._source.set_property('freq', tone.frequency)
self._source.set_property('wave', tone.wave) self._source.set_property('wave', tone.wave)
@ -89,7 +94,7 @@ class sound:
global _gstreamerAvailable global _gstreamerAvailable
if not _gstreamerAvailable: if not _gstreamerAvailable:
return return
self.stop() self.cancel()
self._initialized = False self._initialized = False
_gstreamerAvailable = False _gstreamerAvailable = False