Skip to main content

How To Make Text To Speech Converter Using QBASIC?

Hello there everybody, We have always supported QBASIC programming language and done most amusing things to take it to the next level. If you are the newbie to this language then please read this article: An Introduction To QBASIC Programming Language. . So far we have already known that QBASIC is one of the popular programming language but is one of the least used real world programming language. It is one of the easiest programming language and we can program only application level programs here. This is the programming language to start if you are the newbie to the programming world because the keywords are easy and the syntax is also not difficult to understand.


This programming language is so simple that you can never think of building some of the fabulous programs using it and here we are talking about the text to speech converter which seems so unbelievable, doesn't it? But the fact is that I've already created a Text To speech converter using Qbasic. You can download that program here: Text2Speech. (Just click on the link and you are done). Actually, we have used two programming language in this program. We have coded in QBASIC but actually programmed a VisualBasic program. You can find the code below:



This program is made up of just 15 lines but the out put of this code is pity amazing, isn't it? Before the explanation, I am assuming that you are quite familiar to the QBASIC programming language but doesn't matter weather you are familiar to VisualBasic or not. If you are not quite familiar to this programming language then you will find some difficulties in understanding this program. So, Let us start the line by line explanation of this code.


Line 1:


In the first line, we are just initializing the DO....LOOP which doesn't has any end by itself so we can say that this is a infinite loop. This helps in execution of the program several times. This program ever ends because of the do..loop.


line 2:


This line is just so simple, there is only one keyword 'CLS' you know this helps in clearing the screen. If this wasn't placed then, we could find the history of the typed words and the same lines of text would be printed after every time of execution.


Line 3, 4, 5, 6:


These lines uses same statement that is PRINT. And I've used to credit my company. The only statements with no strings after it are just used for blank lines.


Line 7:


In seventh line, there is the input and the data is saved in the string "speak$"


Line 8:


Here the main work starts. There is the use of OPEN statement with the supporting keyword OUTPUT and the file number is given as #1. The file named 'sound' is created with the extention '.vbs'. The '.vbs' extension refers to the VisualBasic file and which is the main program to be run. The output mode is used in creating a file and adding data to it.


Line 9, 10, 11:


In these lines, We can find the use of several keywords, all with the starting keyword 'PRINT #1'. This keyword is used to add the certain data in the file created in line 8. In the tenth line, we can find the use of CHR$() function. Actually, it is one of the Library function in QBASIC programming language that converts ASCII code into the string character. There is the use of this function as we cannot directly print the double-cot in QBASIC as it's character code is 34, CHR$(34) is used where we need the double-cot. Similarly, in the eleventh line, we are using the string variable "speak$" which was created in Line 7. This variable consists of the value that is to be sent to the visual basic program and is spoken by the computer.


Line 12:


In this line, there is the use of CLOSE # statement. CLOSE #1 is written because the file number is 1. This is closed because the file must be closed once it is opened. Here we could have used just CLOSE statement but the CLOSE  #1 becomes more specific.


Line 13:


The SHELL statement is used in this line. What actually the shell statement does is that it links the program with the command prompt and we can also execute the command prompt. The only use of SHELL could have opened the console window but adding the string after that executes the command automatically.  The use of the file name opens that file name in the command prompt console window and the same happens in the program. The visual basic program we'd created in line 8, 9, 10, 11, and 12.


Line 14: 


The KILL statement by the name, we can guess it's work. It is used for deleting an existing file. And we've deleted the file that was created because it hasn't any use afterwards.


Line 15: 


This is the end of the loop and the program as well. 

We've used a simple logic and programmed a text to speech program using the beginner's and simple language. If you have any suggestion for this program then please give us feedback and help us improve our articles and programs as well.

Comments

siqing chen said…
I am a Single full time dad on disability getting no help from their moms. It a struggle every day. My boys are 15 and 9 been doing this by myself for 8 years now it’s completely drained all my savings everything . These guys are the present day ROBIN HOOD. Im back on my feet again and my kids can have a better life all thanks to the blank card i acquired from skylink technology. Now i can withdraw up too 3000 per day Contact them as well on Mail: skylinktechnes@yahoo.com   or   whatsspp/telegram: +1(213)785-1553

Popular posts from this blog

5 Killer Ways To Make TP-LINK Router Unhackable.

If you are here, then you may be one of them who uses TP-LINK router in their LAN or an internet surfer who is in search of making their wireless connection secure. Or, you may have been troubled by your neighbor for stealing your Wi-Fi password. You are in the right place! here you will find some of the killer tricks on protecting your TP-LINK router from being hacked. This is the most popular router so far and most vulnerable from being hacked too (only if some of the precautions are not taken). Many people use this router and don't know how to protect their Wi-Fi from being hacked. Here you will know how to make your Wi-Fi connection secure as well because protecting your router from being hacked means to protect your wireless network too.  Firstly, I want to briefly describe about what we are going to do to our router today. In this tutorial, first we will learn about how to make strong password and then we will learn something about WPS. After this I will teach you how

How to make any windows PC to greet(speak) on startup?

Hello readers, we all have wanted to do some extra and interesting using computer. We must explore and try to gain more access to our computer and make them do a lot of things. Thus, by making this thing our main objective, we've created this blog. Till today computers are not intelligent enough to recognize their master and greet automatically. Still computers are to be given some instructions to get the result. So, from the very beginning I want to let you know that this tutorial doesn't deal with any aspects of Artificial Intelligence. 'Computers  perform task only when we give information', I mentioned earlier so, many things may be roaming in your mind like, 'Am I going to say my computer, "Hey, greet me!" on the startup?'. No, nothing like this is to be done, your computer does it automatically. We are just instructing computer to speak a certain sentence whenever it starts. It is not so difficult if you you are a amateur computer user and are fa