Skip to content

Commit

Permalink
Remove sound module
Browse files Browse the repository at this point in the history
It's old, unused, unsupported, unmaintained, and never really worked in
the first place.
  • Loading branch information
joanmarie committed Jul 23, 2015
1 parent 86517e3 commit 3715e18
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 97 deletions.
1 change: 0 additions & 1 deletion src/orca/Makefile.am
Expand Up @@ -60,7 +60,6 @@ orca_python_PYTHON = \
script_utilities.py \
settings.py \
settings_manager.py \
sound.py \
speech.py \
spellcheck.py \
speechdispatcherfactory.py \
Expand Down
4 changes: 0 additions & 4 deletions src/orca/settings.py
Expand Up @@ -342,10 +342,6 @@
keyBindingsMap = {}
brailleBindingsMap = {}

# A dictionary where the keys are rolenames and the values are
# filenames containing audio snippets.
sounds = {}

# TODO - JD: Is this still needed now that AT-SPI has its own timeout?
timeoutTime = 10 # a value of 0 means don't do hang checking
timeoutCallback = None # Set by orca.py:init to orca.timeout
Expand Down
67 changes: 0 additions & 67 deletions src/orca/sound.py

This file was deleted.

8 changes: 1 addition & 7 deletions src/orca/speech.py
Expand Up @@ -33,7 +33,6 @@
from . import logger
from . import orca_state
from . import settings
from . import sound
from . import speech_generator

from .acss import ACSS
Expand Down Expand Up @@ -172,7 +171,7 @@ def speak(content, acss=None, interrupt=True):
if settings.silenceSpeech:
return

validTypes = (str, list, sound.Sound, speech_generator.Pause,
validTypes = (str, list, speech_generator.Pause,
speech_generator.LineBreak, ACSS)
error = "bad content sent to speech.speak: '%s'"
if not isinstance(content, validTypes):
Expand All @@ -182,8 +181,6 @@ def speak(content, acss=None, interrupt=True):

if isinstance(content, str):
_speak(content, acss, interrupt)
elif isinstance(content, sound.Sound):
content.play()
if not isinstance(content, list):
return

Expand Down Expand Up @@ -217,9 +214,6 @@ def speak(content, acss=None, interrupt=True):
activeVoice = newVoice
toSpeak = newItemsToSpeak

if isinstance(element, sound.Sound):
element.play()

if toSpeak:
string = " ".join(toSpeak)
_speak(string, activeVoice, interrupt)
Expand Down
18 changes: 0 additions & 18 deletions src/orca/speech_generator.py
Expand Up @@ -36,7 +36,6 @@
from . import object_properties
from . import settings
from . import settings_manager
from . import sound
from . import text_attribute_names
from . import acss

Expand Down Expand Up @@ -111,23 +110,6 @@ def _addGlobals(self, globalsDict):
"""
generator.Generator._addGlobals(self, globalsDict)
globalsDict['voice'] = self.voice
globalsDict['play'] = self.play

def play(self, key):
"""Returns an array containing a sound.Sound instance.
The key can a value to be used to look up a filename in the
settings.py:sounds dictionary (e.g., a pyatspi.ROLE_* value)
or just the name of an audio file to use.
"""
sounds = _settingsManager.getSetting('sounds')
try:
soundBite = sound.Sound(sounds[key])
except:
if isinstance(key, str):
soundBite = sound.Sound(key)
else:
soundBite = None
return [soundBite]

def generateSpeech(self, obj, **args):
return self.generate(obj, **args)
Expand Down

0 comments on commit 3715e18

Please sign in to comment.