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