Speech plugin modified - added clipboard.

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
Jani
Posts: 9
Joined: Tue Sep 01, 2009 10:17 pm

Speech plugin modified - added clipboard.

Post by Jani » Tue Sep 01, 2009 10:27 pm

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.
Attachments
__init__.py
Version 3. Clipboard functionality. Async speaking check box.
(11.52 KiB) Downloaded 259 times
speech_clipboard_async_v3_0.3.7.r1194.zip
Version 3. Clipboard functionality. Async speaking check box.
(1.39 KiB) Downloaded 224 times
speech_clipboard_v2_0.3.7.r1194.zip
Version 2. Clipboard functionality
(946 Bytes) Downloaded 241 times
Last edited by Jani on Wed Sep 02, 2009 9:10 am, edited 4 times in total.

stottle
Plugin Developer
Posts: 636
Joined: Sun Apr 26, 2009 10:59 pm

Re: Speech plugin modified - added clipboard.

Post by stottle » Tue Sep 01, 2009 11:27 pm

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

Jani
Posts: 9
Joined: Tue Sep 01, 2009 10:17 pm

Re: Speech plugin modified - added clipboard.

Post by Jani » Tue Sep 01, 2009 11:53 pm

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.

User avatar
jitterjames
Experienced User
Posts: 677
Joined: Thu Aug 13, 2009 4:36 pm
Location: Quebec, Canada
Contact:

Re: Speech plugin modified - added clipboard.

Post by jitterjames » Sun Sep 06, 2009 3:02 pm

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!

Post Reply