def __init__(self, controller=None): TTSEngine.__init__(self, controller=controller) self.festival_path=helper.find_in_path('festival') self.aplay_path=helper.find_in_path('aplay') if self.festival_path is None: self.controller.log(_("TTS disabled. Cannot find the application 'festival' in PATH")) if self.aplay_path is None: self.controller.log(_("TTS disabled. Cannot find the application 'aplay' in PATH")) self.festival_process=None
def __init__(self, controller=None): TTSEngine.__init__(self, controller=controller) self.festival_path=helper.find_in_path('festival') self.aplay_path=helper.find_in_path('aplay') if self.festival_path is None: logger.warning(_("TTS disabled. Cannot find the application 'festival' in PATH")) if self.aplay_path is None: logger.warning(_("TTS disabled. Cannot find the application 'aplay' in PATH")) self.festival_process=None
def __init__(self, regexp=None, encoding='utf-8', **kw): super(LsDVDImporter, self).__init__(**kw) lsdvd=helper.find_in_path('lsdvd') if lsdvd is None: raise Exception("Cannot find lsdvd") self.command=self.lsdvd + " -c" # FIXME: handle Title- lines #Chapter: 01, Length: 00:01:16, Start Cell: 01 self.regexp="^\s*Chapter:\s*(?P<chapter>\d+),\s*Length:\s*(?P<duration>[0-9:]+)" self.encoding=encoding
def __init__(self, controller=None): TTSEngine.__init__(self, controller=controller) self.language=None self.espeak_path=helper.find_in_path('espeak') if self.espeak_path is None and config.data.os == 'win32': # Try c:\\Program Files\\eSpeak if os.path.isdir('c:\\Program Files\\eSpeak'): self.espeak_path='c:\\Program Files\\eSpeak\\command_line\\espeak.exe' elif os.path.isdir('C:\\Program Files (x86)\\eSpeak'): #winXp 64b self.espeak_path='C:\\Program Files (x86)\\eSpeak\\command_line\\espeak.exe' self.espeak_process=None
def can_run(): """Can this engine run ? """ return helper.find_in_path(CustomArgTTSEngine.prgname) is not None
def __init__(self, controller=None): TTSEngine.__init__(self, controller=controller) self.language=None self.prg_path=helper.find_in_path(CustomArgTTSEngine.prgname)
def can_run(): """Can this engine run ? """ return (os.path.isdir('c:\\Program Files\\eSpeak') or os.path.isdir('C:\\Program Files (x86)\\eSpeak') or helper.find_in_path('espeak') is not None)
def can_run(): """Can this engine run ? """ return (helper.find_in_path('festival') is not None)
gstpath = os.getenv('PATH', "") h, t = os.path.split(ppath) binpath, t = os.path.split(h) os.environ['PATH'] = os.pathsep.join((os.path.join(binpath, 'bin'), gstpath)) try: import gi gi.require_version('Gst', '1.0') from gi.repository import GObject, Gst GObject.threads_init() Gst.init(None) except ImportError: Gst = None APLAY = helper.find_in_path('aplay') def subprocess_setup(): # Python installs a SIGPIPE handler by default. This is usually not what # non-Python subprocesses expect. signal.signal(signal.SIGPIPE, signal.SIG_DFL) class SoundPlayer: def gst_play(self, fname, volume=100, balance=0): """Play the given file through gstreamer. """ if fname.startswith('file:') or fname.startswith('http:'): uri = fname elif config.data.os == 'win32':
def can_run(): """Can this engine run ? """ return helper.find_in_path('festival') is not None
h,t = os.path.split(ppath) binpath,t = os.path.split(h) os.environ['PATH'] = os.pathsep.join( (os.path.join( binpath, 'bin'), gstpath) ) try: import gi gi.require_version('Gst', '1.0') from gi.repository import GObject, Gst GObject.threads_init() Gst.init(None) except ImportError: Gst=None import advene.core.config as config APLAY = helper.find_in_path('aplay') def subprocess_setup(): # Python installs a SIGPIPE handler by default. This is usually not what # non-Python subprocesses expect. signal.signal(signal.SIGPIPE, signal.SIG_DFL) class SoundPlayer: def gst_play(self, fname, volume=100, balance=0): """Play the given file through gstreamer. """ if fname.startswith('file:') or fname.startswith('http:'): uri = fname elif config.data.os == 'win32': uri = 'file:' + urllib.request.pathname2url(fname) else: