View Single Post
Old 10-22-2020, 02:34 PM   #50
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by kovidgoyal View Post
Yeah, it's fully uploaded now.
Thanks. There's plenty for me to get my head around here.

Are all the ISpVoice methods(???) shown in your Git link? Will it still be possible to use the plugin's Select Files/TestVoice page to start/stop ad-hoc speech. I don't see a 'pause' option in your link.

I think I still need some help in how to handle the events stuff that is in the current plugin (inherited, not developed by me). These bits:
Spoiler:
Code:
from win32com.client import WithEvents
class SapiVoice(object):
    self.spv = ...

    def handler(self, event_handler):
        return WithEvents(self.spv, event_handler)

class SAPI5DriverEventSink(object):
    def __init__(self):
        self._driver = None

    def setDriver(self, driver):
        self._driver = driver

    def OnEndStream(self, stream, pos):
        self._driver.OnEndStream(stream, pos)
        
    def OnStartStream(self, stream, pos):
        self._driver.OnStartStream(stream, pos)

class SelNamesDlg(QDialog):
    ...

    def initialize_speech(self):
        ...
        self._advise = self.testVoice.handler(SAPI5DriverEventSink)
        self._advise.setDriver(self)
   ...
jackie_w is offline   Reply With Quote