In macOS we have Option + Esc to speak a word, but in Windows there is no built-in tools to do this, so I wrote scrpit speak.vbs. Just copy the word and run it, it will speak the first work in your clipboard.
I use WinHotKey, and bind to Ctrl + Alt + S. Don't forget to Uncheck Windows permisson notify.
In Linux Speak Clipboard is pretty easy,just run command below,
xclip -o | espeak
You can save it as a Bash script,and use shortcut to execute it。
' 1. Get clipboard text
Set objHtml = CreateObject("htmlfile")
clipBoard = objHtml.ParentWindow.ClipboardData.GetData("text")
If clipBoard <> "" Then ' Do nothing if empty
Dim clipBoardText
clipBoardText = CStr(clipBoard)
clipBoardText = Trim(clipBoardText)
clipBoardText = LCase(clipBoardText)
splitText = Split(clipBoardText, " ")
textToSpeak = splitText(0) ' get only first word
' Test if it has chinese character to avoid error
Set objRegExp = New RegExp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "[^a-zA-Z0-9\s]"
doesWriteLog = True
If objRegExp.Test(clipBoardText) Then
textToSpeak = "character mistake"
doesWriteLog = false
End If
' 2. Speak it
Set sapi = CreateObject("sapi.spvoice")
If Len(textToSpeak) >= 30 Then
sapi.Speak "text too long"
doesWriteLog = false
ElseIf Len(textToSpeak) < 30 Then
sapi.Speak textToSpeak
End If
' 3. Save a log
Set fso = CreateObject("Scripting.FileSystemObject")
strFile = "words.txt"
' Read old
strLine = ""
If (fso.FileExists(strFile)) Then
Set objFileRead = fso.OpenTextFile(strFile)
Do Until objFileRead.AtEndOfStream
strLine = objFileRead.ReadLine
Loop
objFileRead.Close
End If
' Write new
Set objFileWrite = fso.CreateTextFile(strFile, True)
If doesWriteLog Then
objFileWrite.Write strLine + textToSpeak + " " & vbCrLf
Else
objFileWrite.Write strLine + " " & vbCrLf
End If
objFileWrite.Close
End If ' If clipboard empty
2019-01-03 20:24:07
Solove bug for there are Chinease characters in clipboard
2019-01-27 14:09:19
Fix bug for clipboard empty
2019-09-29 18:57:18
Add Linux Speak Clipboard method