Text To Speech Conversion and Custom Voices

Learn how to easily convert text to speech and Install Custom Voicdes on Windows 7!!

Cool Batch Tricks - Part IV

Learn to create a program for Reminder and Decimal to Binary Converter

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Text To Speech Conversion & Custom Voices

Hello guys, how you doing? I am posting on the blog after a very long time. Sorry for that. So, today I am going to explain you two things. One is Converting Text to Speech & installing custom voices for Microsoft TTS Engine.
NOTE: This tutorial will work only on Windows Vista & all the Windows released after it.

Windows Text To Speech




It is a built-in TTS engine in Windows family from Windows 98. It synthesizes text into voice. Every version of Windows comes with different Engines. Each engine has improved the Speech quality. Here’s a list of default speech engines that come with each Windows:-
1.     Windows XP – Microsoft Sam
2.     Windows 7 – Microsoft Anna
3.     Windows 8 – Microsoft Mike
4.     Windows 10 – Microsoft David & Microsoft Zira
After the introduction of the Microsoft Speech API 5.0, the voices became more natural sounding. Unfortunately, Windows 7 comes with Microsoft Anna Built-In which sounds very Robotic.

   1.    Converting Text to Speech

So, to convert Text to Speech, we’re going to be scripting one Batch File that will accept some text & speak it aloud. If you are not familiar with Batch Programming, go and see my Batch Programming Tutorial Series. We’re also going to need to download one Software. It is known as NirCMD. To download it, click here(32-bit) OR click here(64-bit).
So, after downloading it, you should get one file named ‘NirCMD.exe’, we only need this file. Follow the below steps to create your own Text to Speech converting Batch program.
Steps:-
   1.     Create a new folder (for ex. TTS) at a convenient location.
   2.     Copy the ‘NirCMD.exe’ there.

                                
         
   3.     Open Notepad, and type the following code into it
@echo off
Title Text to Speech Converter
set speech=start nircmd.exe speak text
Echo Enter Text to be converted into speech:
Set /p text=Enter Text:
Echo Speaking text aloud..
%speech% "%text%"
Pause

  4.     Save the file with any name (TTS.bat). Just make sure it has ‘.bat’ at the end to make it a bath file. Save it in the same folder in which you copied the ‘NirCMD.exe’ file.




Now, you’ve the Batch File ready. You can make many modifications like changing colors, etc. to make it more user-friendly. Now, open the Batch File, & type the text you want, and the computer will speak it aloud.
Now, the problem is, if you’re on Windows 7, Microsoft Anna (the default voice) sounds very Robotic. This brings us to the Second part of the Post, that is to Add custom voices to Windows 7.



   2.      Adding Custom Voices to Win 7

To add new voices, we will need to download some packages from Microsoft. One is the Microsoft Speech API 5.0 voices & the voice itself. There are many voices available for SAPI 5, but the are not free. Microsoft has 6 free voices(all female). I will leave the links for all the stuff. Now, just installing these packages don’t work(I don’t know Why?).  We have to make some changes to the registry, which is sometimes complex & if any error occurs, it could fatally damage the system.
So, I’ve picked one voice that is ZiraPro. It is the most natural sounding voice, & I’ll provide the registry files that will automatically install. But, if you want to learn how to do it for other voices, then comment down. With sufficient comments, I’ll tell you how to do it.
Follow the steps below correctly to make the voice Work
   1.     Download & install the Windows SAPI 5 voices.
   2.     Then download & install the desired voice(ZiraPro Preferred).
      2.1 Go Here & Click on Download. On the list that appears, look for 'MSSpeech_TTS_en-       US_ZiraPro.msi'. Then click download & install it.
   3.     Then download the following registry entries.
   4.     It’s a Zip. It contains two files. Extract them. Open the first file & click Yes on the Dialog Box that appears. Do the same for the 2nd file.
   5.     Now, if you’re running 32-bit Windows, simply search for TTS in he start menu. Then, click on ‘Change Text To Speech Settings’.
   6.     If you’re running 64-bit windows, then you should run the following command ‘%windir%\SysWOW64\Speech\SpeechUX\sapi.cpl’ without quotes in the Run Dialog Box.
   7.     Then, select ‘Microsoft Server Speech Text to Speech Voice (en-US, ZiraPro)’ from the list.
   8.     Click on OK. You’re Done.

Download Registries Here.
So, that was for this post. If you want me to do more such posts about Text To Speech, then let me know in the comments down below.
If you like this post please support us by sharing the post. Don't Forget to visit our Facebook & Instagram pages,  If you want to contact us, write us at Remedyhub11@gmail.com.


Cool Batch Tricks - Part IV

Yo guys,

        I'm back again with Cool Batch Tricks – Part IV. It’s always better that you go serially.So go and check my previous posts if haven’t. 



It’s better that you see earlier parts as it will help you to understand the code.


So, Let’s start.   

Today, we will again learn two cool programs. They are :-


1.    Decimal TO Binary Converter :-

Yes, this programs converts Decimal Numbers to Binary Form.


Code:


@echo off
title Decimal To Binary Converter
color a
echo.
echo.
echo ---------------------------
echo Decimal To Binary Converter
echo ---------------------------
echo.
echo.
echo Enter a Decimal Number;
set /p a=Number:
set y=%a%
:BIN
set /a "x=%y%%%2%"
set f=%x%%f%
if %y%==1 goto out
set /a "y=y/2"
goto BIN
pause

:out
set f=0%f%
echo %f%
pause
exit





Output:

Converter 



          I won’t be explaining the lines I already explained in previous posts.

          In this program, we first get an input from the user & convert that number into Binary. We use ‘%’ symbol to show mod operation. We’ve used mod and division in a loop to convert the number. We’ve set the condition that when the input number becomes 1 then we come out of the loop. Then we display the eoutput in ‘f’ variable.

2.   Reminder

This program sets a reminder for a specified time. Actually this program is not perfected as Reminder should an a voice message. We’ll introduce how to add Voice to your Batch Scripts in upcoming parts.

Code:

@echo off
color a
:start
cls
title Reminder
echo.
echo.
echo ---------------Reminder-----------------
echo  Tell the time to remind at:
set /p a=Enter Time(24 hrs format: HH:MM[Very Strict]):
echo Give the reminder a Name(One word only)
set /p name=Name:
echo Enter the message to be displayed
set /p msg=Message:
:main
 if not exist %appdata%\Reminder md %appdata%\Reminder\
if exist %appdata%\Reminder\Rem.bat del %appdata%\Reminder\Rem.bat
set NULL=echo.
echo @echo off>>%appdata%\Reminder\Rem.bat
echo set NULL=echo. >>%appdata%\Reminder\Rem.bat
echo color a>>%appdata%\Reminder\Rem.bat
echo :start>>%appdata%\Reminder\Rem.bat
echo %NULL% >>%appdata%\Reminder\Rem.bat
echo echo Hey %username%, it is %a% .You,ve set the following Reminder.>>%appdata%\Reminder\Rem.bat
echo %NULL% >>%appdata%\Reminder\Rem.bat
echo echo REMINDER:%msg%>>%appdata%\Reminder\Rem.bat
echo %NULL%  >>%appdata%\Reminder\Rem.bat
echo %NULL%  >>%appdata%\Reminder\Rem.bat
echo pause >>%appdata%\Reminder\Rem.bat
echo del /Q %appdata%\Reminder\Rem.bat>>%appdata%\Reminder\Rem.bat
echo exit>>%appdata%\Reminder\Rem.bat



:confirm
echo The reminder named %name% will trigger at %a% giving message %msg%
echo Is everything Right??
echo 1. Yes
echo 2. No. Restart Again
set /p x=Choice:
if %x%==2 goto start
schtasks /create /st %a% /tn %name% /tr %appdata%\Reminder\Rem.bat   /sc once
echo.
echo.
title Reminder Set
echo ---------------Reminder Set-----------------
pause


Output:

Main program asking info

       
Reminder triggered at specified time

          

          Here, we’ve used the echo command with ‘>>’ and a directory with using the variable appdata. We can create another text file with the use of this. Here,first take all information from the user assign it to variable place them appropriately in desired places then we create another file namd ‘Rm.bat’. Then we use the schtasks command to trigger the file we just created at specified time. That’s it!!


Batch Files:                              1. DEC TO BIN Converter
                                                        2. Reminder(No voice)



So, these were the two programs of this tutorial. If you like this post please support us by sharing the post. Don't Forget to visit our Facebook & Instagram pages, If you want to contact us, write us at Remedyhub11@gmail.com & don’t forget to subscribe.


        

Cool Batch Tricks - Part III

Hello guys,

        I'm back again with the 3rd part of Cool Batch Tricks. If you’re seeing this post, you must have seen the earlier posts, if you haven’t then click here.

       Cool Batch Tricks - Part I                                          Cool Batch Tricks - Part II

 Its better that yo see earlier parts as it will help you to understand the code.


So, Let’s start.   

Today, we will again learn two cool programs. They are :-


1.    Shutdowm Program

This programs schedules a Shutdown process after a specified period of time. You can Shutdown, Restrart, Log Off, Hibernate your Windows with this program


Code:


@echo off
color a
title Aborting Shutdown
echo Aborting Shutdown
shutdown.exe -a
if %errorlevel%==1116 goto timer
echo The Shutdown was Aborted
pause
exit

:timer
title Settng Up Shutdown
cls
echo.
echo.
echo WARNING : Timer Does not work with Log Off and Hibernate
echo.
echo.
set time=000
echo Enter the time-out period in seconds
set /p time=Time:
echo Time set as %time% seconds

:choice
echo What you want to do:
echo.
echo 1. Shutdown & set p1=Shutdown
echo 2. Restart & set p2=Restart
echo 3. Log Off & set p3=Log_Off
echo 4. Hibernate & set p4=Hibernate
echo.
echo Choose Your Option:
set /p a=Option:
if %a%==1 set p=%p1% & shutdown.exe -s -t %time%
if %a%==2 set p=%p2% & shutdown.exe -r -t %time%
if %a%==3 set p=%p3% & shutdown.exe -l
if %a%==4 set p=%p4% & shutdown.exe -h -t
echo Your computer will %p% in %time% seconds
pause
exit






Output:

Aborting Shutdown


Shutting Down after 500 Secs
        




          I won’t be explaining the lines I already explained in previous posts.

          This program first Aborts any shutdown if any is predefined. For this we use the shutdown.exe with parameter /a. Here another variable named ‘errorlevel’ is introduced. If a command is performed and if any error occurs then the error code is stored in this variable. We use this to check for any predefined shutdowns, if there are any it will terminate them and exit. Other wise, it jumps to the next section. As warned, the timer doesn’t work for Log Off and Hibernate. As you can see, we’ve used & in some lines. It is used for starting a new line.

          I hope you understand the program. If not then comment your problem.
We’ll definitely help you.

2.   Task Manager

We know there exists a GUI application, but it would be more cool to get a CLI.

Code:

@echo off
Title Task Manager
color a
:start
cls
echo.
echo.
echo ------------
echo Task Manager
echo ------------
echo.
echo.
echo What you want to do??
echo 1. Get Tasklist
echo 2. Create a new task
echo 3. End a Task
echo 4. Exit
set /p c=Choice:
if %c%==1 goto tasklist
if %c%==2 goto newtask
if %c%==3 goto endtask
if %c%==4 goto exit
echo Wrong Choice
pause
goto start

:tasklist
cls
echo The current running tasks are :-
echo.
tasklist
pause
goto start

:newtask
cls
echo Enter the path of the new task :
set /p p=Path with filename and extension:
start %p%
if %errorlevel%==9059 goto error
echo Task has been successfully launched
pause
goto start

:error
cls
if %errorlevel%==9059 echo The path or program name is incorrect
if %errorlevel%==128 echo The program %tname% is not running
pause
goto start

:endtask
cls
echo Enter the name of the task to end:
set /p tname=Name (without extension):
taskkill /IM %tname%.exe
if %errorlevel%==128 goto error
echo The program %tname% was successfully terminated
pause
goto start

:exit
cls
echo Exitting Program...
pause
exit


Output:

Show Tasklist

       
Create Fucntion


          Here, we’ve used the three commands for three different functions. They are tasklist to show task List,start to start an application,taskkill to End a Task. It may look lengthy but it is very simple to understand. The command taskkill is used with varius parameters. For ex. You can modify the code and end a task by using it Process ID. For that open Command Prompt and type, taskkill /?.

Batch Files :                                  1. Shutdown 
                                                      2. Task Manager


So, these were the two programs of this tutorial. If you like this post please support us by sharing the post. Don't Forget to visit our Facebook & Instagram pages, If you want to contact us, write us at Remedyhub11@gmail.com & don’t forget to subscribe.


        

Cool Batch Tricks - Part II

Hello guys,

        I'm back again with the 2nd part of Cool Batch Tricks. In this series, I present some cool Batch Files & try to explain how they work. If you still haven’t seen the first part of the series, Click Here.You should watch the first part as it will help you to understand the code.


So, Let’s start.   

Today, we will again learn two cool but very easy and programs. They are :-


1.    Folder Bomber

     This program creates folders with random names. You can set a limit or create unlimited folders (Can be used as a Virus, but IF SOMETHING WRONG HAPPENS DON’T BLAME ME)

Code:

@echo off
Title Folder Bomber
color a
:start
cls
echo.
echo.
echo NOTE : Folders will be bombed in a folder called bomb
echo.
echo.
echo.
echo.
echo Folder Bomber
echo.
echo.
echo Choose an Option??
echo 1. Limited
echo 2. Unlimited
set /p a=Enter Choice:
if %a%==1 goto limited
if %a%==2 goto unlimited
cls
echo Wrong Choice
pause
goto start

:unlimited
md bomb\%random%
cls
goto unlimited
pause

:Limited
set i=0
echo How many folders to bomb??
set /p b=Enter no. of Folders

:s
md bomb\%random%
set /a "i=i+1"
if %i%==%b% goto exit
goto s

:exit
echo %b% folders bombed successfully
pause>nul
exit







Output:



          I won’t be explaining the lines I already explained in previous posts.

          The 2nd line ‘Title Folder Bomber’ sets the Title to Folder Bomber in the Title Bar. The command’echo.’ Is used to print a blank line.
         
          The if condition checks that if value of a is equal to 1, if true, then it directs the interpreter to the ‘Limited’ Section. The same is for next if condition.
         
          The ‘cls’ command is used to clear the screen. The ‘md’ command means Make directory. It creates a new directory named ‘bomb’ & also creates a sub-directory of the value of random.

          In limited Section we set the value of variable ‘i’ to 0. Then we create a loop with a condition inside it. If the condition is matched then the interpreter jumps out of the loop, else it repeats the commands in the loop.

          We’ve used nul in front of pause with ‘>’, so pause won’t display any text when executed.

2.   Calculator

As the name suggests, this program is used to calculate the values of expressions entered.


Code:

@echo off
color a
Title Calculator
:Start
cls
echo -----------
echo Calculator
echo -----------
echo Enter the expression you want to calculate
set /p e=Expression :
set /a "x=%e%"
echo The answer is %x%
echo Do you want to calculate another expression ?
set /p y=Press NO to exit :
if %y%==No GOTO Exit
if %y%==NO GOTO Exit
if %y%==no GOTO Exit
GOTO start
pause
:Exit
echo Exitting Program...
pause
exit


Output:


       

          Here, we’ve used the set command with another parameter i.e ‘/a’. With this parameter, we can calculate the the value of an expression. We get the expression through the variable ‘e’ and set the output value of this expression to’x’. Then we print the variable ‘x’. Then we ask the user to repeat the process or not. Thus, it is so simple


Batch Files:                                              1.  Folder Bomber                               
                                                                  2.  Calculator


So, these were the two programs of this tutorial. If you like this post please support us by sharing the post. Don't Forget to visit our Facebook & Instagram pages, If you want to contact us, write us at Remedyhub11@gmail.com & don’t forget to subscribe.