Through this article, you can learn how to import common DLL files to the. NET hosted environment and develop a simple text reading system.
The last time I used win7 speech recognition, I thought it could be improved. Later I read an article about speech development while reading magazines in the library, although the article only briefly introduces the use of a dll library file, I am still very interested. then I tried it.
First download the SAPI. dll file: http://u.115.com/file/f4d3df0e16
Then, we need to use the vstool tlbimp.exe to export the SAPI to the managed dynamic link library for use in the. NET environment. The specific operation is to find the vs menu in the Start Program, which contains Visual Studio Tools, and then open the Visual Studio 2008 command prompt.
Enter the tlbimp [SAPI. dll full directory]/out: dotnetspeech. dll command to ignore warnings and errors.
Then you can use the DLL file.
Open vs008, create a C # project, add references, and reference the dotnetspeech file.
Introduce the namespace: Using dotnetspeech;
The test code is as follows:
Class Program
{
Static void main (string [] ARGs)
{
Speechvoicespeakflags spflags = speechvoicespeakflags. svsflagsasync;
Spvoice sp = new spvoice ();
Sp. Speak ("Haha, hello, my name is Hu Yang", spflags );
Console. Read ();
}
}
Without an accident, you can hear the computer sound. If there is no sound, check your headset first. If there is no sound, leave a message.
The above is just a preliminary application. You can use your imagination as much as possible. For example, if I like to read novels, but sometimes my eyes are uncomfortable, ask someone to help me read them. Okay, you have an idea. Do it. So with the following small program, you can download it and play it.
Diagram:
: Http://u.115.com/file/f42727e66e
About extended development:
As a matter of fact, I also want to write the speech recognition part, that is, let the computer execute the speech. However, because there is a built-in voice recognition in the win7 system, the speech recognition of the system will be started every time the Code is run. It is estimated that the voice recognition of the win7 system is also developed based on this library. So wait for another day to change the system to XP and try again.
Extensions:
1. speech recognition is a little difficult, so it is so easy to read the text, so you can simply read the text and you can do something. One of my thoughts is to integrate a gossip chat window plug-in, when someone sends you a message, it can be read automatically. Although it is not easy, it is a similar software that has been used in the past. If you are interested, you can look for it. You can continue to use it.
2. This is naturally the addition of speech recognition. It is so interesting to build a speech conversation system and talk to a computer. One day I can't stand it, so I will develop one. ()
URL extension:
Http://hi.baidu.com/mrmobilerobot/blog/category/%BC%C6%CB%E3%BB%FA%D3%EF%D2%F4
PS:
Speech SDK 5.1 address: http://www.microsoft.com/downloads/en/details.aspx? Familyid = 5e86ec97-40a7-440f-b0ee-6583171b4530 & displaylang = en
Original article, reprint please indicate the source: http://www.the5fire.net /? P = 69