Jump to content

Text to Speech (use of Clipboard)


Go to solution Solved by Noviceatthis,

Recommended Posts

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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...