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]
enabled=False,
driver=sox
enabled=True
driver=gstreamer
theme=default
[speech]
enabled=True
driver=espeak
rate=800
#driver=espeak
#language=en-us
#voice=en-us
driver=speechd
#rate=800
rate=50
volume=100
pitch=50
module=espeak
voice=en-us
language=en-us
volume=200
voice=de
language=de
[braille]
enabled=False
layout=en
[screen]
['screen]
driver=linux
[keyboard]
@ -28,3 +33,4 @@ wordEcho=True
[general]
debugLevel=0
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 \
not ttyChanged:
return environment
if ttyChanged:
environment['runtime']['outputManager'].playSoundIcon(environment,'ChangeTTY')
environment['runtime']['outputManager'].presentText(environment, environment['screenData']['newDelta'], ttyChanged)
return environment
def setCallback(self, callback):
pass

View File

@ -41,8 +41,9 @@ class outputManager():
if environment['runtime']['soundDriver'] == None:
return
print(soundIconName)
environment['runtime']['soundDriver'].playSoundFile( environment['soundIcons'][soundIconName], interrupt)
try:
print(environment['soundIcons'][soundIconName])
environment['runtime']['soundDriver'].playSoundFile(environment, environment['soundIcons'][soundIconName], interrupt)
environment['runtime']['soundDriver'].playSoundFile(environment['soundIcons'][soundIconName], interrupt)
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('"',"")
validSoundIcon = False
FilePath = ''
if os.path.exists(Values[1]):
FilePath = Values[1]
validKeyString = True
validSoundIcon = True
else:
if not soundIconPath.endswith("/"):
soundIconPath += '/'
if os.path.exists(soundIconPath + Values[1]):
FilePath = soundIconPath + Values[1]
validSoundIcon = True
if validSoundIcon:
environment['soundIcons'][soundIcon] = FilePath
siConfig.close()
print(environment['soundIcons'])
return environment
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 time
from gi.repository import GLib
try:
@ -18,33 +19,37 @@ class sound:
return
self.init()
def _onPlayerMessage(self, bus, message):
if message.type == Gst.MessageType.EOS:
self._player.set_state(Gst.State.NULL)
elif message.type == Gst.MessageType.ERROR:
self._player.set_state(Gst.State.NULL)
error, info = message.parse_error()
print(error, info)
print('drin')
def _onPipelineMessage(self, bus, message):
if message.type == Gst.MessageType.EOS:
self._pipeline.set_state(Gst.State.NULL)
elif message.type == Gst.MessageType.ERROR:
self._pipeline.set_state(Gst.State.NULL)
error, info = message.parse_error()
print(error, info)
print('drin')
def _onTimeout(self, element):
element.set_state(Gst.State.NULL)
return False
def playSoundFile(self, fileName, interrupt=True):
if interrupt:
self.stop()
self.cancel()
self._player.set_property('uri', 'file://%s' % fileName)
self._player.set_state(Gst.State.PLAYING)
def playFrequence(self, frequence, duration, adjustVolume, interrupt=True):
if interrupt:
self.stop()
self.cancel()
self._source.set_property('volume', tone.volume)
self._source.set_property('freq', tone.frequency)
self._source.set_property('wave', tone.wave)
@ -89,7 +94,7 @@ class sound:
global _gstreamerAvailable
if not _gstreamerAvailable:
return
self.stop()
self.cancel()
self._initialized = False
_gstreamerAvailable = False