Chinese in. NET, the English voice has better support, but the Chinese voice support has not yet joined in, we want to achieve Chinese pronunciation or Chinese speech recognition, must first install the Microsoft Speech Application SDK (SASDK), its latest version is SAPI 5.1 He can identify three languages in Chinese, Japanese and English, you can download here: http://www.microsoft.com/speech/download/sdk51/, you need to install these two files speech SDK 5.1 and 5.1 Language Pack, Where the 5.1 Language pack can choose to install the supported languages.
Once installed, we can start to develop the voice program, of course, before we need to add SAPI.dll to the reference in the following figure
Below we design a class that can read the mixed language in Chinese and English:
We'll implement the class in a single example, and the code for the class is as follows, and we'll explain in more detail:
In private speechlib.spvoiceclass voice =null; Here, we define a class for pronunciation and initialize it with the Buildspeach method the first time the class is invoked.
We have also defined two properties volume and rate to set the volume and speed.
We know that Spvoiceclass has a speak method, and we pronounce it mainly by passing a string to him, which reads the string as follows.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.