How to use text to speech and speech to text conversion with Microsoft Speech Platform 11?
Download: | msp-11.zip | |
Download: | ms-speech-platform.zip |
This article gives information about how to use text-to-speech and speech-to-text with Microsoft Speech Platform (Version 11) in relation with Ozeki VoIP SIP SDK. After reading through this page you will be able to use it for reading out loud texts in different languages, and recognize incoming voices. Below you can see what you will need for creating your own solution:
Download: Microsoft Speech Platform - Software Development Kit (SDK) (Version 11)
Download: Microsoft Speech Platform - Runtime (Version 11)
What is Microsoft Speech Platform 11 used for?
Text to speech conversion means that a program reads up the text you have typed in.
This can be useful when for example a mute person wants to communicate with voice calls.
Text to speech conversion can also be used in interactive voice response (IVR) systems
if you want to have the IVR tree navigation information read out by the computer.
You can learn more about this conversion from the How to use TextToSpeech article.
Speech recognition can be used for a lot of thing. It basically works with some
standard algorithms that recognize words. The most essential usage of this technology
is when you want to communicate with a deaf person using voice call. You talks into
the microphone and at the other end the deaf user can see what you said in written form.
You can learn more about this feature from the How to implement Voice Recognition article.
How to use Microsoft Speech Platform 11 in C#?
There are a few important steps which must be made before you can start to develop you softphone (or other application):
- Download and install the Microsoft products, listed above. Please note that, at the language selection languages are being separated with "SR" (Speech Recognition) and "TTS" (Text-To-Speech) tags in order to their purposes.
-
Download the msp-11.zip file, which contains two classes:
- MSSpeechPlatformSTT: a class for voice recognition
- MSSpeechPlatformTTS: a class for Text-To-Speech
-
Create a new Visual Studio project, and:
- Add reference to Ozeki VoIP SIP SDK.
- Add reference to Microsoft.Speech.dll similar way you did with ozeki.dll.
- Add the above downloaded classes to the project.
- If you are using 64 bit edition, make sure about at the project properties "Build" tab, the "Prefer 32-bit" checkbox is not checked, otherwise it may couse errors.
After these steps, you can begin to develop your softphone. Since you are already familiar with Text-To-Speech and Speech-To-Text implementations, only the new steps and taks will be introduced here.
Text-To-Speech: in the case of this conversion, you have to use the TextToSpeech object's AddTTSEngine() method, to pass a new instance of the MSSpeechPlatformTTS to it. After that, you can reach the available voices by calling the object's GetAvailableVoices() method, and you can set the selected one with the ChangeLanguage() one.
Speech-To-Text: you should set a new instance of MSSpeechPlatformSTT as new engine to the SpeechToText object with its ChangeSTTEngine() method. After that, you can reach all the available recognizers with the object's GetRecognizers() method, and you can set the selected one with the object's ChangeRecognizer() method.
Usage example of Microsoft Speech Platform 11 in C#
using System; using System.Threading; using Ozeki.Media; namespace Microsoft_Speech_Platform { class Program { static Speaker _speaker; static Microphone _microphone; static MediaConnector _connector; static TextToSpeech _tts; static SpeechToText _stt; static void Main(string[] args) { _microphone = Microphone.GetDefaultDevice(); _speaker = Speaker.GetDefaultDevice(); _connector = new MediaConnector(); SetupTextToSpeech(); SetupSpeechToText(); while (true) Thread.Sleep(10); } static void SetupTextToSpeech() { _tts = new TextToSpeech(); _tts.AddTTSEngine(new MSSpeechPlatformTTS()); var voices = _tts.GetAvailableVoices(); foreach (var voice in voices) { if (voice.Language.Equals("en-GB")) _tts.ChangeLanguage(voice.Language, voice.Name); } _speaker.Start(); _connector.Connect(_tts, _speaker); _tts.AddAndStartText("Hello World!"); } static void SetupSpeechToText() { string[] words = {"Hello", "Welcome"}; _stt = SpeechToText.CreateInstance(words); _stt.WordRecognized += stt_WordRecognized; _stt.ChangeSTTEngine(new MSSpeechPlatformSTT()); var recognizers = _stt.GetRecognizers(); foreach (var recognizer in recognizers) { if (recognizer.Culture.Name == "en-GB") _stt.ChangeRecognizer(recognizer.ID); } _connector.Connect(_microphone, _stt); _microphone.Start(); } static void stt_WordRecognized(object sender, SpeechDetectionEventArgs e) { Console.WriteLine("Word recognized: {0}", e.Word); } } }
Download Text to Speech languages:
- Chinese (Hong Kong) TTS Engine
- Chinese (PRC) TTS Engine
- Chinese (Taiwan) TTS Engine
- Danish (Denmark) TTS Engine
- Dutch (Netherlands) TTS Engine
- English (Australia) TTS Engine
- English (Canada) TTS Engine
- English (India) TTS Engine
- English (United Kingdom) TTS Engine
- English (United States) TTS Engine
- English (United States Zira Pro) TTS Engine
- Finnish (Finland) TTS Engine
- French (Canada) TTS Engine
- French (France) TTS Engine
- German (Germany) TTS Engine
- Italian (Italy) TTS Engine
- Japanese (Japan) TTS Engine
- Korean (Korea) TTS Engine
- Norwegian (Norway) TTS Engine
- Polish (Poland) TTS Engine
- Portuguese (Brazil) TTS Engine
- Portuguese (Portugal) TTS Engine
- Russian (Russia) TTS Engine
- Spanish (Catalan) TTS Engine
- Spanish (Mexico) TTS Engine
- Spanish (Spain) TTS Engine
- Swedish (Sweden) TTS Engine
Download Speech to Text languages:
Related Pages
More information
- How to build a softphone voip sip client
- Register to SIP PBX
- Voip softphone development
- How to encrypt voip sip calls with sip encryption
- How to encrypt voip sip calls with rtp encryption
- How to ring a sip extension csharp example for sip invite
- How to make a sip voice call using csharp
- Voip multiple phone lines
- How to send stream of voice data into call using csharp microphone
- How to receive voice from SIP voice call using csharp speaker
- How to make conference voice call using voip sip
- How to play an mp3 file into a voice call using csharp
- How to convert text to speech and play that into a call using csharp
- How to use Microsoft Speech Platform 11 for TTS and STT
- How to record voip sip voice call
- How to accept incoming call using csharp
- How to reject incoming call using csharp
- How to read Headset buttons using Bluetooth
- How to implement auto answer using csharp
- How to recognize incoming voice using speech to text conversion
- Voip forward call
- Voip blind transfer
- Voip attended transfer
- Voip do not disturb
- Voip call hold
- SIP Message Waiting Indication
- Voip DTMF signaling
- How to work with sip and sdp in voip sip calls
- How to work with rtp in voip sip calls
- How to make voip video calls in csharp
- Voip video codec
- Shows how to use SpeechToText Google API
- How to convert Text to Speech using C# and Google
- Azure Text-to-Speech