It is working on local system but not working on live server. I am getting error:
NullReferenceException: Object reference not set to an instance of an object.]
System.Speech.Internal.ObjectTokens.SAPICategories.DefaultDeviceOut() +79
System.Speech.Internal.Synthesis.VoiceSynthesis..ctor(WeakReference speechSynthesizer) +969
System.Speech.Synthesis.SpeechSynthesizer.get_VoiceSynthesizer() +77
System.Speech.Synthesis.SpeechSynthesizer.SetOutputToNull() +55
System.Speech.Synthesis.SpeechSynthesizer.SetOutputStream(Stream stream, SpeechAudioFormatInfo formatInfo, Boolean headerInfo, Boolean closeStreamOnExit) +16
System.Speech.Synthesis.SpeechSynthesizer.SetOutputToWaveStream(Stream audioDestination)
Make sure you that the Microsoft Speech Platform is correctly installed on your server.
Also see this note at the bottom of the Microsoft Speech Platform SDK 11 Requirements and Installation page.
Finally, seeing as the nullref occurs specifically at the
DefaultDeviceOut()method, ensure your server actually has some kind of audio out capability.