Text To Speech - VB6 | Visual Basic 6











Click here for source files.


"Test to speech - Noobgrammer is a simple project which simply converts text into speech. It includes features like saving the text content on the file and retrieving the content from file. This project, initially, was created for making a voice-over for my YouTube videos. Later, I realized why not to share this with others.


This, project somehow looks like old version notepad and features are also alike. The main feature, I personally like, is the auto-generation of file name. Now, let's deep dive on this project. 


Visual Basic version 6 (vb6) has been used to develop this project.


Features :

The features included in this project are mentioned below :

  1. Text to speech conversion
  2. Saving content on the file.
  3. File name is auto generated.
  4. Loading content from file.
  5. Files saved on disk are displayed
  6. Clearing screen for new file creation.
  7. Notify user if same content is already saved previously.
  8. Existing files' content can be updated.
  9. Tips included.


Objects used

For developing this kind of application, we need to have the knowledge of following objects : 

  1. FileListBox
  2. Form
  3. Frame
  4. Command button
  5. Label
  6. Text box
  7. Timer

Concepts description

1. Saving content in a file mechanism

When a command button (Save New) is pressed, first of all, emptiness of text in textbox is checked. If and only if the textbox is not empty. It enters the new condition. That is, the content is checked with the content saved in a file previously. When no data redundancy is ensured, next step is to generation of filename. For this purpose, I thought an idea to concatenate number with the filename. The idea is, if that filename is already present in a disk,   previously concatenated number is incremented by one and again checked the presence of file with that name. When a filename is finally finalized ensuring the absence of file with that name, content present on the textbox is written on a file.


2. Updating file content

This one is lightly easier task. The filename of the file which is to be updated is used and updated with ease. 


3. Checking the presence of file

This task is more trickier part where I have used error handling. First of all, after a generation of filename, that file is opened in input mode, an error occurs if the file is absent. In such occurrence of error, new file is created by opening the file in output mode. On the other hand, if an error does not occur, meaning the presence of file, new filename is generated.

 

4. Loading the file content 

The available text file is listed on the FileListBox on the form load time. From that list, a file can be either clicked once and press the "Load the content"(command button) or directly double click on the file for loading the content of the file on the textbox. When a file is chosen, the filename is extracted for updating and saving purpose which can be used if necessary.  


5. Clearing screen mechanism

This one has the simplest concept. When a Clear Screen - command button is pressed, the text of textbox is replaced with ""(blank), which clear out every thing present on the text box. 


6. Use of timer

At last, this one hit my mind. I thought to display some tips regarding the use of program, but using timer so that the tips is alternately shown on the screen. Since I had only two tips to show, I used boolean value of this. That is, when a bool value if true tip number one is shown and hold for five seconds then the bool value is switched to opposite and another tip is shown.  

No comments:

Post a Comment

Article Ad1