where is Microsoft Speech Object Library 5.1 option in PythonWin 2.5?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • siggi

    #1

    where is Microsoft Speech Object Library 5.1 option in PythonWin 2.5?

    Hi all,

    newbie question:
    I'd like to try speech synthesis with PythonWin 2.5.

    Problem
    ******
    according to several instructions, such as found on

    and in a book on Python,

    I have to select Tools | COM MakePy Utility | Microsoft Speech Object
    Library 5.1, SDK 5.1, that is.

    However, in my Python 2.5/PythonWin 2.5 installation I find as only option
    "Microsoft Speech Object Library 5.0" to select.

    Unfortunately, 5.1 is the lowest SDK version I found on
    http://www.microsoft.com/downloads/d...kInfoContainer

    Will this PythonWin's Tools | COM MakePy Utility for 5.0 work with SDK 5.1?

    Or will PythonWin's Tools | COM MakePy Utility be updated to SDK 5.1, once
    I have SDK 5.1 installed?

    Thanks,

    Siggi
















  • Gabriel Genellina

    #2
    Re: where is Microsoft Speech Object Library 5.1 option inPythonWin 2.5?

    At Friday 5/1/2007 11:24, siggi wrote:
    >However, in my Python 2.5/PythonWin 2.5 installation I find as only option
    >"Microsoft Speech Object Library 5.0" to select.
    This list shows all the COM objects currently registered in Windows,
    does not depend on Pythonwin.
    >Unfortunatel y, 5.1 is the lowest SDK version I found on
    >http://www.microsoft.com/downloads/d...kInfoContainer
    After you download and install version 5.1, it should appear on the list.


    --
    Gabriel Genellina
    Softlab SRL






    _______________ _______________ _______________ _____
    Preguntá. Respondé. Descubrí.
    Todo lo que querías saber, y lo que ni imaginabas,
    está en Yahoo! Respuestas (Beta).
    ¡Probalo ya!


    Comment

    • Siggi

      #3
      Re: where is Microsoft Speech Object Library 5.1 option inPythonWin 2.5?

      Gabriel Genellina wrote:
      After you download and install version 5.1, it should appear on the list.
      It should, but it does not! Shutting down and starting the WinXP Home system
      anew did not help.
      The SDK 5.1 installation went smoothly, however. What can I do to find out
      what is wrong?

      siggi

      "Gabriel Genellina" <gagsl-py@yahoo.com.ar schrieb im Newsbeitrag
      news:mailman.23 30.1168015570.3 2031.python-list@python.org ...
      At Friday 5/1/2007 11:24, siggi wrote:
      >
      >>However, in my Python 2.5/PythonWin 2.5 installation I find as only option
      >>"Microsoft Speech Object Library 5.0" to select.
      >
      This list shows all the COM objects currently registered in Windows, does
      not depend on Pythonwin.
      >
      >>Unfortunately , 5.1 is the lowest SDK version I found on
      >>http://www.microsoft.com/downloads/d...kInfoContainer
      >
      After you download and install version 5.1, it should appear on the list.
      >
      >
      --
      Gabriel Genellina
      Softlab SRL
      >
      >
      >
      >
      >
      _______________ _______________ _______________ _____ Preguntá. Respondé.
      Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en
      Yahoo! Respuestas (Beta). ¡Probalo ya! http://www.yahoo.com.ar/respuestas


      Comment

      • Jussi Salmela

        #4
        Re: where is Microsoft Speech Object Library 5.1 option inPythonWin2.5?

        Siggi kirjoitti:
        Gabriel Genellina wrote:
        >
        >After you download and install version 5.1, it should appear on the list.
        >
        It should, but it does not! Shutting down and starting the WinXP Home system
        anew did not help.
        The SDK 5.1 installation went smoothly, however. What can I do to find out
        what is wrong?
        >
        siggi
        >

        (Sorry for the long post!)


        Unfortunately I can't comment on this 5.0/5.1 issue but if you look at page
        http://www.cs.unc.edu/~parente/tech/tr02.shtml
        you'll find the pyTTS system. I've used it and everything works.

        The funny thing is that the page has a link named "Microsoft SAPI 5.1
        redistributable " which links to
        http://www.cs.unc.edu/Research/assis...hInstaller.msi
        ie. a SAPI 5 installer. So I'm starting to wonder if it matters at all
        whether the speech kit is a version 5 or 5.1.

        Anyway: pyTTS works with Python 2.4 as advertized in the accompanying
        examples. I've used it to resolve the following dilemma: how to
        guarantee that I'm aware of new mail appearing on my ISP.

        I had an unfortunate experience where a guy I was working with sent me
        (to my home) mail that I didn't expect to receive just at the moment and
        to which I would have liked to react immediately. Why I didn't notice
        the mail coming: I was outside my house pumping more air to my wife's
        bicycle tires! The mail notification was shown and erased and one more
        icon among the more than dozen icons on my Windows System Tray didn't
        account for much.

        So I figured out that a voice to remind me would be nice. I have a low
        rate inbox, usually only a maximum of hald a dozen messages per day so I
        wouldn't have to listen the voice all day long. So the voice keeps
        repeating that I have new mail at my ISP until I download the mail and
        otherwise keeps quiet. So here is my program and a skeleton of the INI
        file it uses. The program is not finished (I have a few ideas still) but
        it runs all day long on my computer keeping me happy.

        =============== ===========
        New Email Notifier.py
        =============== ===========
        #!/usr/bin/python

        '''
        License: MIT License. See License.txt. If that file is not attached,
        the license is http://www.opensource.org/licenses/mit-license.php,
        where
        <year= 2006 and <copyright holders= Jussi Salmela, Turku, Finland
        '''

        # This program checks for new email at ISP and notifies if new email is
        found

        import win32serviceuti l
        import win32service
        import win32event
        import pyTTS, sys, os, poplib, logging, time
        import ConfigParser,py wintypes

        print '\nThis is the New Mail Notifier window\n'
        notifierDirecto ry = r'C:\Python\OMA T___PROJEKTIT\N ew Email Notifier Service'
        logging.basicCo nfig(level=logg ing.DEBUG,
        format='%(ascti me)s %(levelname)-8s %(message)s',
        filename=notifi erDirectory+r'\ error.log')
        logging.info('= =============== =============== =============== ===========')
        logging.info('N ew Email Notifier Service started')
        config = ConfigParser.Co nfigParser()
        config.readfp(o pen(notifierDir ectory+r'\New Email Notifier.INI'))
        POP3Server = config.get('POP 3','server')
        POP3Account = config.get('POP 3','account')
        POP3Password = config.get('POP 3','password')
        totalMessagesFo rmat = config.get('mes sages','total_m essage')
        newMessagesForm at = config.get('mes sages','new_mes sage')
        wakeupMessageFo rmat = config.get('mes sages','wakeup_ message')

        tts = pyTTS.Create()
        #set the speech volume percentage (0-100%)
        tts.Volume = 100
        #explicitly set a voice
        tts.SetVoiceByN ame(u'MSMary')

        uidDict = {}
        # We wait to be stopped and check for new email every maxTimeToWait seconds
        maxTimeToWait = 1 # First check after 1 second
        while True:
        time.sleep(maxT imeToWait)
        maxTimeToWait = 60 # Rest of the checks after 60 second
        try:
        # Connect to the ISP
        a = poplib.POP3(POP 3Server,110)
        answer = a.getwelcome()
        if answer[0:3] != '+OK':
        raise ValueError,'a.g etwelcome returned: ' + answer
        answer = a.user(POP3Acco unt)
        if answer[0:3] != '+OK':
        raise ValueError,'a.u ser returned: ' + answer
        if answer[4:] == 'Password required':
        answer = a.pass_(POP3Pas sword)
        if answer[0:3] != '+OK':
        raise ValueError,'a.p ass_ returned: ' + answer
        answer = a.uidl()
        if answer[0][0:3] != '+OK':
        raise ValueError,'a.u idl returned: ' + repr(answer)
        a.quit()
        # Connection closed. Start handling the unique message identifiers
        #logging.info(' Connection succesfully opened, used and closed!')
        print 'answer', answer, time.asctime()
        uidList = [e.split()[1] for e in answer[1]]
        print 'uidList', uidList
        totalMessages = len(uidList)
        uidDictNew = {}
        for e in uidList: uidDictNew[e] = True
        uidList = [e for e in uidList if e not in uidDict]
        uidDict = uidDictNew
        if totalMessages:
        tts.Speak(total MessagesFormat % totalMessages)
        newMessages = len(uidList)
        if newMessages:
        tts.Speak(newMe ssagesFormat % newMessages)
        except Exception,inst:
        errorMsg = 'Unexpected error: %s' % sys.exc_info()[0]
        logging.error(e rrorMsg)
        logging.error(i nst)
        try:
        tts.Speak(wakeu pMessageFormat)
        tts.Speak('I repeat: ' + wakeupMessageFo rmat)
        tts.Speak(error Msg)
        tts.Speak(inst)
        except pywintypes.com_ error,inst:
        errorMsg = 'Unexpected error: %s' % sys.exc_info()[0]
        logging.error(e rrorMsg)
        logging.error(i nst)

        =============== ===========
        New Email Notifier.INI
        =============== ===========
        [POP3]
        server: myPOPserver
        account: myAcoount
        password: myPassword
        [messages]
        total_message: Your eemail server has. a total of %d messages. for you
        to download
        new_message: The number of new messages. since the last check. is %d
        wakeup_message: Wake up, Youssi! This is your new eemail notifier,
        reporting the following error!

        HTH,
        Jussi

        Comment

        • Siggi

          #5
          Python and SDK5.1 are just terrific!!!

          Thanks, Jussi, for your post, but I found that PythonWin's SDK5.0 option
          works well with MS SDk5.1.
          Just had an Email read for me using a small Python program: correct English,
          even the date such as 12/06/06 was correctly transformed into the names of
          the month and year. Python is great1

          Siggi


          "Jussi Salmela" <tiedon_jano@ho tmail.comschrie b im Newsbeitrag
          news:0Kynh.432$ sE.358@read3.in et.fi...
          Siggi kirjoitti:
          >Gabriel Genellina wrote:
          >>
          >>After you download and install version 5.1, it should appear on the
          >>list.
          >>
          >It should, but it does not! Shutting down and starting the WinXP Home
          >system anew did not help.
          >The SDK 5.1 installation went smoothly, however. What can I do to find
          >out
          >what is wrong?
          >>
          >siggi
          >>
          >
          >
          (Sorry for the long post!)
          >
          >
          Unfortunately I can't comment on this 5.0/5.1 issue but if you look at
          page
          http://www.cs.unc.edu/~parente/tech/tr02.shtml
          you'll find the pyTTS system. I've used it and everything works.
          >
          The funny thing is that the page has a link named "Microsoft SAPI 5.1
          redistributable " which links to
          http://www.cs.unc.edu/Research/assis...hInstaller.msi
          ie. a SAPI 5 installer. So I'm starting to wonder if it matters at all
          whether the speech kit is a version 5 or 5.1.
          >
          Anyway: pyTTS works with Python 2.4 as advertized in the accompanying
          examples. I've used it to resolve the following dilemma: how to guarantee
          that I'm aware of new mail appearing on my ISP.
          >
          I had an unfortunate experience where a guy I was working with sent me (to
          my home) mail that I didn't expect to receive just at the moment and to
          which I would have liked to react immediately. Why I didn't notice the
          mail coming: I was outside my house pumping more air to my wife's bicycle
          tires! The mail notification was shown and erased and one more icon among
          the more than dozen icons on my Windows System Tray didn't account for
          much.
          >
          So I figured out that a voice to remind me would be nice. I have a low
          rate inbox, usually only a maximum of hald a dozen messages per day so I
          wouldn't have to listen the voice all day long. So the voice keeps
          repeating that I have new mail at my ISP until I download the mail and
          otherwise keeps quiet. So here is my program and a skeleton of the INI
          file it uses. The program is not finished (I have a few ideas still) but
          it runs all day long on my computer keeping me happy.
          >
          =============== ===========
          New Email Notifier.py
          =============== ===========
          #!/usr/bin/python
          >
          '''
          License: MIT License. See License.txt. If that file is not attached,
          the license is http://www.opensource.org/licenses/mit-license.php,
          where
          <year= 2006 and <copyright holders= Jussi Salmela, Turku, Finland
          '''
          >
          # This program checks for new email at ISP and notifies if new email is
          found
          >
          import win32serviceuti l
          import win32service
          import win32event
          import pyTTS, sys, os, poplib, logging, time
          import ConfigParser,py wintypes
          >
          print '\nThis is the New Mail Notifier window\n'
          notifierDirecto ry = r'C:\Python\OMA T___PROJEKTIT\N ew Email Notifier
          Service'
          logging.basicCo nfig(level=logg ing.DEBUG,
          format='%(ascti me)s %(levelname)-8s %(message)s',
          filename=notifi erDirectory+r'\ error.log')
          logging.info('= =============== =============== =============== ===========')
          logging.info('N ew Email Notifier Service started')
          config = ConfigParser.Co nfigParser()
          config.readfp(o pen(notifierDir ectory+r'\New Email Notifier.INI'))
          POP3Server = config.get('POP 3','server')
          POP3Account = config.get('POP 3','account')
          POP3Password = config.get('POP 3','password')
          totalMessagesFo rmat = config.get('mes sages','total_m essage')
          newMessagesForm at = config.get('mes sages','new_mes sage')
          wakeupMessageFo rmat = config.get('mes sages','wakeup_ message')
          >
          tts = pyTTS.Create()
          #set the speech volume percentage (0-100%)
          tts.Volume = 100
          #explicitly set a voice
          tts.SetVoiceByN ame(u'MSMary')
          >
          uidDict = {}
          # We wait to be stopped and check for new email every maxTimeToWait
          seconds
          maxTimeToWait = 1 # First check after 1 second
          while True:
          time.sleep(maxT imeToWait)
          maxTimeToWait = 60 # Rest of the checks after 60 second
          try:
          # Connect to the ISP
          a = poplib.POP3(POP 3Server,110)
          answer = a.getwelcome()
          if answer[0:3] != '+OK':
          raise ValueError,'a.g etwelcome returned: ' + answer
          answer = a.user(POP3Acco unt)
          if answer[0:3] != '+OK':
          raise ValueError,'a.u ser returned: ' + answer
          if answer[4:] == 'Password required':
          answer = a.pass_(POP3Pas sword)
          if answer[0:3] != '+OK':
          raise ValueError,'a.p ass_ returned: ' + answer
          answer = a.uidl()
          if answer[0][0:3] != '+OK':
          raise ValueError,'a.u idl returned: ' + repr(answer)
          a.quit()
          # Connection closed. Start handling the unique message identifiers
          #logging.info(' Connection succesfully opened, used and closed!')
          print 'answer', answer, time.asctime()
          uidList = [e.split()[1] for e in answer[1]]
          print 'uidList', uidList
          totalMessages = len(uidList)
          uidDictNew = {}
          for e in uidList: uidDictNew[e] = True
          uidList = [e for e in uidList if e not in uidDict]
          uidDict = uidDictNew
          if totalMessages:
          tts.Speak(total MessagesFormat % totalMessages)
          newMessages = len(uidList)
          if newMessages:
          tts.Speak(newMe ssagesFormat % newMessages)
          except Exception,inst:
          errorMsg = 'Unexpected error: %s' % sys.exc_info()[0]
          logging.error(e rrorMsg)
          logging.error(i nst)
          try:
          tts.Speak(wakeu pMessageFormat)
          tts.Speak('I repeat: ' + wakeupMessageFo rmat)
          tts.Speak(error Msg)
          tts.Speak(inst)
          except pywintypes.com_ error,inst:
          errorMsg = 'Unexpected error: %s' % sys.exc_info()[0]
          logging.error(e rrorMsg)
          logging.error(i nst)
          >
          =============== ===========
          New Email Notifier.INI
          =============== ===========
          [POP3]
          server: myPOPserver
          account: myAcoount
          password: myPassword
          [messages]
          total_message: Your eemail server has. a total of %d messages. for you to
          download
          new_message: The number of new messages. since the last check. is %d
          wakeup_message: Wake up, Youssi! This is your new eemail notifier,
          reporting the following error!
          >
          HTH,
          Jussi

          Comment

          Working...