Sign in to follow this  
Followers 0
Noviceatthis

Text to Speech (use of Clipboard)

2 posts in this topic

I'm trying to write a script that reads text from the clipboard and then gets the computer to say it, here's what I have so far:

#include <Clipboard.au3>

$oldclip = ""

While 1
    Global $currentclip = _ClipBoard_GetData()
    If $currentclip = "0" Then
        Sleep(1000)
    ElseIf $currentclip = $oldclip Then
        Sleep(1000)
    Else
        speak()
    EndIf

    $oldclip = $currentclip
WEnd

Func speak()
    $voice = ObjCreate("SAPI.SpVoice")
    $voice.speak($currentclip)
EndFunc   ;==>speak

It works for single lines of text, but not for text including a paragraph, i.e.

"This works"

"But this

doesnt"

I was wondering whether there was a solution to this

Thanks in advance

 

Share this post


Link to post
Share on other sites



Ah, no, it does work, apologies

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0