Friday, November 4, 2016

bat programming වලින් Text to Speech එකක් හදාගමු.





මේකෙන් වෙන්නේ ඇත්තටම කලින් පොස්ට් එකක දාපු vbs file එක auto හැදිලා වඩේ ඉවර උනාට පස්සේ auto delete වෙන එක. මෙන්න පල්ලෙහා ඇති code එක

@echo off
@mode con cols=55 lines=10
title PMG Ekanayake Text To Speech
color c
:st
echo *******************************************************
echo Please type what you would like  to hear from me master
echo *******************************************************
echo.
set /p command=
cls
cd "%userprofile%\desk*"
if exist Talk_.vbs del Talk_.vbs
copy NUL Talk_.vbs
cls
ping localhost -n 2 > nul
echo strText = ("%command%")> "Talk_.vbs"
echo Set objvoice = CreateObject("SAPI.SpVoice")>> "Talk_.vbs"
echo ObjVoice.Speak strText>> "Talk_.vbs"
cls
echo Analyzing text input
echo please wait
ping localhost -n 1 > nul
echo.
echo ² ² 0%%
ping localhost -n 1 > nul
cls
echo Analyzing text input
echo please wait
echo.
echo ²ÛÛ ² 9%%
ping localhost -n 1 > nul
cls
echo Analyzing text input
echo please wait
echo.
echo ²ÛÛÛÛÛ ² 22%%
ping localhost -n 2 > nul
cls
echo Analyzing text input
echo please wait
echo.
echo ²ÛÛÛÛÛÛÛ ² 31%%
ping localhost -n 2 > nul
cls
echo Analyzing text input
echo please wait
echo.
echo ²ÛÛÛÛÛÛÛÛÛ ² 40%%
ping localhost -n 1 > nul
cls
echo Analyzing text input
echo please wait
echo.
echo ²ÛÛÛÛÛÛÛÛÛÛÛ ² 49%%
ping localhost -n 1 > nul
cls
echo Analyzing text input
echo please wait
echo.
echo ²ÛÛÛÛÛÛÛÛÛÛÛÛÛ ² 58%%
ping localhost -n 1 > nul
cls
echo Analyzing text input
echo please wait
echo.
echo ²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ² 63%%
ping localhost -n 1 > nul
cls
echo Analyzing text input
echo please wait
echo.
echo ²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ² 72%%
ping localhost -n 1 > nul
cls
echo Analyzing text input
echo please wait
echo.
echo ²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ² 81%%
ping localhost -n 1 > nul
cls
echo Analyzing text input
echo please wait
echo.
echo ²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ² 91%%
ping localhost -n 1 > nul
cls
echo Analyzing text input
echo please wait
echo.
echo ²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ² 100%%
ping localhost -n 5 > nul
cls
cd "%userprofile%\desk*"
start Talk_.vbs
ping localhost -n 3 > nul
del Talk_.vbs
cd..
cls
goto st

pramesh ekanayake Web Developer

Follow

No comments:

Post a Comment