Page 1 of 1

Speech plugin modified - added clipboard.

Posted: Tue Sep 01, 2009 10:27 pm
by Jani
I modified the speech plugin to read aloud the contents of Windows clipboard. I don't know Python, but I managed to create this hack :)

I've attached a diff file as a zip, because .diff was not allowed, and also the modified EventGhost/plugins/Speech/__init__.py file.

EDIT: Unicode support added, version 2.

EDIT2: Added check box for async/sync speaking.

Re: Speech plugin modified - added clipboard.

Posted: Tue Sep 01, 2009 11:27 pm
by stottle
Ok, one of the nice things about plugins is people can create stuff that they are interested in. You get some neat ideas that you wouldn't have thought of yourself.

For the life of me, though, I can't think of what in the world do you use this for? :?:

Brett

Re: Speech plugin modified - added clipboard.

Posted: Tue Sep 01, 2009 11:53 pm
by Jani
stottle wrote:For the life of me, though, I can't think of what in the world do you use this for? :?:
I'm using the speech plugin to read aloud the name of the current song. I have speakers outside, so can't be bothered to get inside to find out the title of the song. Don't know about you :) You could copy like your mail count to clipboard and then read it aloud or something..

EDIT: it seems to have a problem with unicode chars. As I said, I know nothing about Python - any suggestions to fix?

Code: Select all

UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 6: ordinal not in range(128)
EDIT2: Nvm, using win32con.CF_UNICODETEXT instead of win32con.CF_TEXT seems to do the trick.

Re: Speech plugin modified - added clipboard.

Posted: Sun Sep 06, 2009 3:02 pm
by jitterjames
I'm using the speech plugin to read aloud the name of the current song
It's just that you don't need to use the clipboard to do that. You can just send eg.result directly to the speech plugin.

I think using the clipboard should be avoided whenever possible, since it may interfere with a user who is using the clipboard for something else. You wouldn't want to cut something important to the clipboard and then when you go to paste it you get a song name instead!