Use the text voice development package to implement voice reading function
I recently wandered online, I found a text voice development package, using it, can easily implement the text into the function of voice output. I have always been more optimistic about the development of software voice, even Bill Gates, the trend of text operating system, graphic operating system, the next technology development is the voice version of the operating system, although there is no contact with Windows XP, but heard that it is integrated A certain functional voice program.
Gossip less, after downloading the development package, after research, I found that it is very simple to join the voice function through this development package, although the function is limited, but let me only vb programming, a simple statement, You can realize that there is a voice function in my software.
Before using the development package, you must go to the software website to download the voice package, the website: http://www.smartysoft.cn/smvoices/download.html, you can download the corresponding voice package according to your needs, install it to your computer. Among them, there is a Chinese language: realize the Chinese language reading function; English and spending English LAN reading function, of course, you can download them together, call different speech libraries in different needs. Of course, I think this is inevitable, but the files of the speech library have some big, my software is about 1M, but a Chinese language is fast to 1.7M, the software volume is getting bigger. Of course, different people have different views, maybe some people don't care? Ha ha!
Below, I will explain the voice function by an instance.
The first step is to place the SmartRead.dll dynamic link library in the same folder as the system folder or run file, because this file is the core file of voice implementation, and the software must be able to find it. There is this link library in the development package, you can copy it.
In the second step, open VB, create a module, and enter the following statement at the code page.
TYPE BE_VERSION
Bydllmajorversion as Byte
Bydllminorversion as byte
ChDay As Long
CHMONTH AS Long
Chyear As Long
End Type
This is the structure of the development package version model, including software version, software development time. Of course, if you don't want to know at all, this step can also be done.
In the third step, create a new form, join:
Private Declare Function Dll_SmartRead_InitialVB Lib "smartread.dll" (ByVal hwndFrom As Long) As LongPrivate Declare Function Dll_SmartRead_CloseVB Lib "smartread.dll" (ByVal bNull As Long) As LongPrivate Declare Function Dll_SmartRead_SetDialogVB Lib "smartread.dll" (ByVal hwndFrom As Long) As LongPrivate Declare Function Dll_SmartRead_SpeakVB Lib "smartread.dll" (ByVal str As String, ByVal bstyle As Long) As LongPrivate Declare Function Dll_SmartRead_StopVB Lib "smartread.dll" (ByVal bNull As Long) As LongPrivate Declare Function Dll_SmartRead_VersionVB Lib "smartread.dll" (BYVAL BNULL AS Long) AS BE_VERSITIONPRIVATE DECLARE FUNCTION DLL_SMARTREAD_INITIALVB LIB "Smartrea This is a smartread.dll dynamic link library, the function's declaration, can be seen from the function name, which is a function of VB. I briefly introduced a few Basic features of a function.
DLL_SMARTREAD_INITIALVB: Used to initialize voice function, must be initially called
DLL_SMARTREAD_CLOSEVB: Used to turn off voice function, call before the program exits, release resources
DLL_SMARTREAD_SPEAKVB: Reading Functions.
DLL_SMARTREAD_STOPVB: Stop Lang Read Function
DLL_SMARTREAD_SETDIALOGVB: Used to open voice settings dialog, changing voice, volume, speed, etc.
DLL_SMARTREAD_VERSIONVB: Display the development package version information (this function can not be used, if you want to use, you must make a second step)
Step 4, you can now implement voice function in the software.
1. Call DLL_SMARTREAD_INITIALVB
DIM DDD AS Long
DDD = dll_smartread_initialvb (me.hwnd) 'calling the initialization function
2. Call DLL_SMARTREAD_SETDIALOGVB
DIM DDD AS Long
DDD = DLL_SMARTREAD_SETDIALOGVB (me.hwnd) 'Call the setting function, can change to Chinese language
3. Use DLL_SMARTREAD_SPEAKVB
DIM DDD AS Long
DDD = DLL_SMARTREAD_SPEAKVB ("Chinese Voice Development Pack", 0) 'Reading Functions
4. Call DLL_SMARTREAD_CLOSEVB
DIM BNULL AS Long
DIM DDD AS Long
DDD = DLL_SMARTREAD_STOPVB (BNULL) 'Call Stop Lang Read Function
5. Call DLL_SMARTREAD_CLOSEVB
DIM BNULL AS Longdim DDD As Long
DDD = DLL_SMARTREAD_CLOSEVB (BNULL) 'Call Close Function
So, the use of the development package is very simple. If you don't have a very demand, the text voice development package can meet your requirements, of course, if you think that the development package is not enough, you will study Microsoft's Speech API, but It is not so simple to realize it, and the radish greens are all good.
If you are interested in this way, you can take a look at the website of the text voice development package, and now I have launched the 1.1 version. http://www.smartysoft.cn/smartreadsdk/index.html
Finally, you must explain that this development package is just a test version, there will be a registration prompt. If you want to get a full-featured version, you must register, specifically, to go to the URL above.