ထူးေတာ့ မထူးဆန္းပါဘူး အရင္ကလဲ ရိွခဲ့ပါတယ္ Notepad သံုးျပီးအသံထြက္ခိုင္တဲ့ပိုစ္ေတြ
ဒါေပမယ့္ အရင္ေတြ့တဲ့ post ေတြမွာ Notepad ထဲမွာကိုယ္ အသံထြက္ခ်င္တဲ့ စကားလုံးေတြ
ကို Code ေတြနဲ့ ေရာေရးရပါတယ္ အခုေတာ့အဲလိုမဟုတ္ပါဘူး ေအာက္မွာေပးထားတဲ့ Code
ေတြကို Notepad ထည္မွာ Copy/Paste လုပ္ျပီး File Type တြင္ All File လုပ္ျပီး
name.html လို့ တစ္ခါ Save လိုက္ရံုနဲ့ရပါတယ္....ကူးထည့္ရမယ္ကုတ္ေတြကေတာ့---
<html>
<head>
<title>SpeakIt</title>
<HTA:APPLICATION
APPLICATIONNAME="SpeakIt"
ID="SpeakIt"
VERSION="1.0"
MAXIMIZEBUTTON="no"
SCROLL="no"/>
</head>
<script language="VBScript">
Sub Window_OnLoad
Dim width,height
width=460
height=470
self.ResizeTo width,height
End Sub
Function PInt()
Set WshShell = CreateObject("WScript.Shell")
Set fs = CreateObject("Scripting.FileSystemObject")
If (boxa.value = "") Then
X = MsgBox("Enter the path for the text file to speak!", 48, "ERROR!")
Else If Not (fs.FileExists(boxa.value)) Then
X = MsgBox("The specified file does not exist!", 48, "ERROR!")
Else
path = WshShell.SpecialFolders("Templates")
Set a = fs.CreateTextFile(path & "\Script.vbs")
a.WriteLine("Set fs = CreateObject(" & Chr(34) & "Scripting.FileSystemObject" & Chr(34) & ")")
a.WriteLine("Set WshShell = CreateObject(" & Chr(34) & "WScript.Shell" & Chr(34) & ")")
a.WriteLine("path = WshShell.SpecialFolders(" & Chr(34) & "Templates" & Chr(34) & ")")
a.WriteLine("Set sapi = CreateObject(" & Chr(34) & "sapi.spvoice" &Chr(34) & ")")
a.WriteLine("Set a = fs.OpenTextFile(" & Chr(34) & boxa.value & Chr(34) & ")")
a.WriteLine("text = a.ReadAll")
a.WriteLine("sapi.Speak text")
a.Close
X = SetTimeOut("Speak()", 500)
End If
End If
End Function
Function Intialize()
If (box.value = "") Then
X = MsgBox("Enter the text to speak!", 48, "ERROR!")
Else
Set WshShell = CreateObject("WScript.Shell")
Set fs = CreateObject("Scripting.FileSystemObject")
path = WshShell.SpecialFolders("Templates")
Set a = fs.CreateTextFile(path & "\Script.vbs")
Set b = fs.CreateTextFile(path & "\XFile.txt")
b.Write(box.value)
a.WriteLine("Set fs = CreateObject(" & Chr(34) & "Scripting.FileSystemObject" & Chr(34) & ")")
a.WriteLine("Set WshShell = CreateObject(" & Chr(34) & "WScript.Shell" & Chr(34) & ")")
a.WriteLine("path = WshShell.SpecialFolders(" & Chr(34) & "Templates" & Chr(34) & ")")
a.WriteLine("Set sapi = CreateObject(" & Chr(34) & "sapi.spvoice" &Chr(34) & ")")
a.WriteLine("Set a = fs.OpenTextFile(path " & Chr(38) & " " & Chr(34) & "\XFile.txt" & Chr(34) & ")")
a.WriteLine("text = a.ReadAll")
a.WriteLine("sapi.Speak text")
a.Close
b.Close
X = SetTimeOut("Speak()", 500)
End If
End Function
Function Speak()
Set WshShell = CreateObject("WScript.Shell")
path = WshShell.SpecialFolders("Templates")
X = WshShell.Run(path & "\Script.vbs")
End Function
Function StopSpeaking()
Set WshShell = CreateObject("WScript.Shell")
X = WshShell.Run("taskkill /im wscript.exe /f", 7)
End Function
</script>
<body bgcolor="white">
<table align="center">
<caption><hr><b>SpeakIt</b><hr></caption>
<tr>
<td>Enter the text file path to speak:</td>
</tr>
<tr>
<td align="center"><input type="text" id="boxa" size="65"></td>
</tr>
<tr>
<td align="center"><input id="BTNA" type="button" value="Speak it!" onclick="PInt()" style="width:420px;height:30px;"></td>
</tr>
<tr>
<td>Enter the text to speak:</td>
</tr>
<tr>
<td align="center"><textarea cols="50" rows="10" id="box"></textarea></td>
</tr>
<tr>
<td align="center"><input id="BTN" type="button" value="Speak it!" onclick="Intialize()" style="width:420px;height:30px;"></td>
</tr>
<tr>
<td align="center"><input id="BTNS" type="button" value="Stop Speaking" onclick="StopSpeaking()" style="width:420px;height:30px;"></td>
</tr>
</table>
</body>
</html>
အေပါ္ကကုတ္ေတြကို Notepad တြင္ ကူးထည့္ျပီး name.html နဲ့ Save ရင္ ကိုယ္ အသံထြက္ေစခ်င္တဲ့ စကားလံုးကို
အလြယ္တကူ အသံထြက္ခိုင္းလို့ ရပါျပီ.... တစ္ခါတေလ ခက္ခဲတဲ့ အဂ္လိပ္စာလံုး အသံထြက္ေတြကို စစ္ေဆးလို့ရတာေပါ့...
Txan Moe
Chief Admin Of www.fullpremiumnowfree.com