我在呼叫 SIP 呼叫时使用 Microsoft Speech Platform 和 Ozeki VOIP Sip Client 来播放 TextToSpeech 消息。如何设置 TTS 以在 Ozeki 中永久循环消息?
我正在为 Ozeki 使用这个 nuget 包:http ://www.nuget.org/packages/ozeki.voip.sip.client/
这是我的代码:
var textToSpeech = new TextToSpeech();
var msp = new MSSpeechPlatformTTS();
textToSpeech.AddTTSEngine(msp);
var clientLanguage = ConfigurationManager.AppSettings["TextSpeechLanguage"];
var voices = textToSpeech.GetAvailableVoices();
foreach (var voice in voices)
{
if (voice.Language == clientLanguage)
textToSpeech.ChangeLanguage(voice.Language, voice.Name);
}
if (string.IsNullOrEmpty(speechString))
{
textToSpeech.ChangeLanguage("en-GB");
speechString = "You have a visitor. Press 1 to accept the visit. Press 2 to talk the the visitor.";
}
mediaSender.AttachToCall(call);
connector.Connect(textToSpeech, mediaSender);
textToSpeech.AddAndStartText(speechString);