To make text audible is to turn the content of the text into sound output, that is, let the computer read out the contents of the text. This function is undoubtedly very useful in the practical teaching work. In Office XP Excel, there is the "from Text to Speech" feature, but must be implemented in an Excel environment, which gives us the ability to apply this functionality. Therefore, the author considers whether can open out the Excel environment, so that any text will be audible program. Through practice, the author uses VB6. 0 developed the "text aloud" program. The following is a brief introduction to the development process.
1. General Ideas
Create a Standard EXE project, create three command button controls on a form, a common dialog box control, and a RichTextBox control, and then through the triggering event of the [Open File] button, select the text file to read aloud, output the text to the RichTextBox box, and then pass the [ Start aloud button to trigger an event, call the Excel object's speech scheme, and read all the text in the RichTextBox box.
2. Preparatory work
To install Office XP on your computer first, install the Speech feature during Setup. Then, using the speech item in Control Panel, expand the Speech Properties dialog box, select the language, select Microsoft Simplified Chinese in the Drop-down box, or select the Chinese speech feature, otherwise you can read English without reading Chinese. You can also set the different voice and speech speed generated by your computer in this dialog box.
Second, in VB6.0, you reference common dialog boxes and RichTextBox two parts.
3. dialog boxes and the creation of controls
(1) Establish a Standard EXE project, named "Txtsound", the dialog box named "Frmsound".
(2) A RichTextBox control and a label control are arranged on the dialog box, named Richt and Lebt respectively.
(3) Add three command buttons to the dialog box, the first is the [Open File] button, named Cmdopen; the second is the [Start aloud] button, named Cmdread; the third is the Exit button, named Cmdexit.
(4) At the end of the dialog box, add a common dialog box, named Comd, whose Filter property is set to ". Txt,.rtf".