C # Implementation of speech text reading-TTS

Source: Internet
Author: User

TTS, short for Text To Speech, is a technology that uses Speech To read texts. Currently, queuing systems are widely used in China.

Windows TTS usually uses the Speech API provided by Microsoft.

Next, let's talk about how C # uses TTS to read text:

Starting from. NET 3.0, the. NET Framework provides the managed Speech API call method, which is very smooth. Instead of sticking to the tedious non-hosted COM call.

. Net 3.0 implementation code:

Using System. Speech. Synthesis; SpeechSynthesizer synth = new SpeechSynthesizer (); synth. Speak ("Hello, world! How are you? "); Synth. Dispose ();

From. NET 4.0, added a dynamic binding function, so that C # Can Be Like VB. NET, the post-binding method is used to use the COM object, so that the direct COM call is also very simple.

. Net 4.0 implementation method:

Type type = Type. GetTypeFromProgID ("SAPI. SpVoice"); dynamic spVoice = Activator. CreateInstance (type); spVoice. Speak ("Hello, welcome to CSharp 4.0! ");

Note:

Here, we also release TTS5.1 together:

Download SDK 5.1, speechsdk51.exe, here

Http://download.microsoft.com/download/ B /4/3/B4314928-7B71-4336-9DE7-6FA4CF00B7B3/SpeechSDK51.exe

, Speechsdk51langpack.exe, here

Http://download.microsoft.com/download/ B /4/3/B4314928-7B71-4336-9DE7-6FA4CF00B7B3/SpeechSDK51LangPack.exe

SDK 5.1 voice file, speechsdk51msm.exe, here

Http://download.microsoft.com/download/ B /4/3/B4314928-7B71-4336-9DE7-6FA4CF00B7B3/SpeechSDK51MSM.exe

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.