Friday, July 2, 2010

ကိုယ္ႀကိဳက္တဲ့ စာသားထဲ့ပီး ကြန္ပ်ဴတာကိ ု တတြတ္တြတ္ ႐ြတ္ခိုင္းရေအာင္…

ကိုယ္ႀကိဳက္တဲ့ စာသားထဲ့ပီး ကြန္ပ်ဴတာကို တတြတ္တြတ္ ႐ြတ္ခိုင္းရေအာင္...

ေအာက္က code ကို notepad ထဲ paste ပီး any name.vbs နဲ႔ သိမ္းပီး ျပန္ဖြင့္ၾကည့္ရင္...

သင့္စက္က သင့္ကို ...
၁) ဘာေျပာရမလဲ ေမးပါမယ္။
၂) ဘယ္ႏွစ္ခါ ေျပာရမလဲ ေမးပါမယ္။
၃) ျမန္ျမန္ေျပာရမလား၊ ေျဖးေျဖးေျပာရမလား ေမးပါမယ္။

ပီးရင္ ခိုင္းေစတဲ့ အတိုင္း ႐ြတ္ျပပါလိမ့္မယ္။

နမူနာ စာသားကေတာ့ "Hi! welcome to real family." ေပါ့။ သူ႕အစား ကိုယ္သိခ်င္တဲ့ စာလံုးကို ႐ိုက္ထဲ့ပီး အသံထြက္ ႐ွာၾကည့္ႏိုင္ပါတယ္။
ဥပမာ။ rendezvous
100200300400 စသျဖင့္ ေပါ့။ အရင္ ျမင္ဖူးတာနဲ႔ ဘာကြာလည္း ဆိုေတာ့ ဒီဗား႐ွင္းက အခ်က္ ၁၊ ၂၊ ၃၊ အကုန္ အ႐ွင္ပါ။ အီးလို ၾကိဳက္ရာ ႐ြတ္ခိုင္းလို႔ ရပါတယ္။

ဥပမာ။ ခ်က္နဲ႔ ဘဏ္မွာ ထုတ္မဲ့ေငြပမာဏကို in words ခ်ေရးဖို႔ အၾကံအိုက္ေနတဲ့အခါမ်ိဳးမွာလည္း အသံုးတဲ့ပါလိမ့္မယ္။

ကုတ္ကို အစိမ္းေရာင္ ခ်ယ္ျပထားပါတယ္။

'အစနဲ႔ အဆံုး၊ စပိ သတ္မွတ္မယ္။
Dim intMax, intStart, intSpeed

'ဘာ႐ြတ္ျပေစခ်င္လဲ သတ္မွတ္မယ္။
Dim message, sapi,strError

'႐ြတ္ေစခ်င္တဲ့စာသားေတာင္းမယ္။
message=InputBox("Enter the text you want spoken (in English please!)", _
"Speak This", _
"Hi! welcome to real family.")

'ဘယ္ႏွစ္ခါ ႐ြတ္ေပးရမလဲ ေမးမယ္။
intMax=CInt(InputBox("How many time do you want to hear? " & _
message & vbcrlf & _
"Please not more than 32,766", "Times should I repeat?",10))-1

'၃၂၇၆၇ထက္မ်ားလည္း အယ္ရာမတက္ေအာင္ ခ်ိန္ပါမယ္။
If intMax >32766 then intMax = 32766

'ဘေလာက္စပိနဲ႔ ႐ြတ္ရမလဲ။ ေျဖးေျဖးလား။ ျမန္ျမန္လား။
intSpeed=CInt(InputBox("In what rate do you want to hear? " & _
vbcrlf & "minimum = -10 to maximum = 10," & _
vbcrlf & "Normal is 0 (Zero)", "Times should I repeat?",-2))

If intSpeed>10 then intSpeed= 10
If intSpeed<-10 then intSpeed= -10

'႐ြတ္ေပးမည့္ အင္ဂ်င္ကို ႏိႈးမယ္။
'အင္ဂ်င္မ႐ွိရင္ အယ္ရာ တက္မယ္။
Set sapi=CreateObject("sapi.spvoice")

'စပိခ်ိန္ပါမယ္။
sapi.rate=intSpeed

'အသံ ကေတာ့ အက်ယ္ဆံုးနဲ႔
sapi.Volume = 100

'စ႐ြတ္မယ္။
intStart=0
'အႀကိမ္ မျပည့္မခ်င္း ျပန္ေက်ာ့ဖို႔ loop ပတ္မယ္။
Do while intStart <= intMax
'တစ္ခါေက်ာ့ရင္ တစ္ခါ႐ြတ္
sapi.Speak (message)
'ဘယ္ႏွစ္ခါ ႐ွိပလဲ မွတ္ထားတယ္။
intStart=intStart+1
'အၾကိမ္ျပည့္ရင္ ေတာ္ပီေပါ့။
Loop

'စက္စိတ္မညစ္ေအာင္ ျပန္သိမ္းပါမယ္။
Set sapi=Nothing
WScript.Quit

/ဧးသိမ္း/

No comments :

Post a Comment

ကြန္းမန္႔ေလး ထားခဲ့ပါလား