def find_tts(): screen_readers=["Dolphin","jaws","NVDA","Unnamed Output","VoiceOver","Window-Eyes"] outputs=Auto().outputs sr=None for possible_output in outputs: if not possible_output.name in screen_readers: #revirce for sapi continue if possible_output.is_active(): sr=possible_output return sr
def announce(message, urgent=False): """Speak and braille a message related to UI.""" global _auto_output if not config.conf["general"]["announce_ui_messages"]: return if _auto_output is None: _auto_output = Auto() _auto_output.speak(message, interrupt=urgent) _auto_output.braille(message)
def announce(message, urgent=False): """Speak and braille a message related to UI.""" global _auto_output if not config.conf["general"]["announce_ui_messages"]: return if _auto_output is None: try: _auto_output = Auto() except AttributeError: import shutil, win32com shutil.rmtree(win32com.__gen_path__, ignore_errors=True) return announce(message, urgent) _auto_output.speak(message, interrupt=urgent) _auto_output.braille(message)
class SpeechUtil: def __init__(self, sapi=True): self._screenreader = Auto() self._history = [] self._position = 0 def speak(self, message): self._history.append(message) self._position = len(self._history) - 1 self._screenreader.output(message) def speakItem(self, message): self._screenreader.output(message) def silence(self): activeScreenreader = self._screenreader.get_first_available_output() if activeScreenreader.name == "NVDA": activeScreenreader.silence() else: self._screenreader.speak(" ", interrupt=True) def nextSpeechHistory(self): historyLength = len(self._history) if (self._position + 1) >= historyLength: self.speakItem(self._history[self._position]) else: self._position += 1 self.speakItem(self._history[self._position]) def previousSpeechHistory(self): historyLength = len(self._history) if (self._position - 1) < 0: self.speakItem(self._history[self._position]) else: self._position -= 1 self.speakItem(self._history[self._position])
import application, wx, os, requests, sys, random, library, logging, columns, config from gmusicapi.exceptions import CallFailure from accessible_output2.outputs.auto import Auto from shutil import copy as shcopy, rmtree RE = (requests.exceptions.RequestException, requests.adapters.ReadTimeoutError, IOError) from sound_lib.main import BassError from time import time, ctime from gui.lyrics_viewer import LyricsViewer from gui.search_frame import SearchFrame, songs from gui.url_frame import URLFrame from copy import copy from threading import Thread, current_thread output = Auto() logger = logging.getLogger('Functions') id_fields = [ 'storeId', 'id', 'trackId', 'nid', ] def format_title(track): stuff = {} # Stuff for format(). try: for k, v in track.items(): stuff[k] = getattr(columns, 'parse_%s' % k, lambda value: value)(v)
"""Accessibility system.""" from accessible_output2.outputs.auto import Auto system = Auto()
from accessible_output2.outputs.auto import Auto ao2 = Auto()
def __init__(self, sapi=True): self._screenreader = Auto() self._history = [] self._position = 0