Search code examples
c#ucma

In UCMA voicexml browser giving Runasync() method not supporting


I am currently using UCMA 4.0 and implementing one sample that is based on IVR. When I am running sample it's giving "Specified method is not supported."

I wrote following code for playing IVR on call.

public void playIVR()
    {
        Microsoft.Rtc.Collaboration.AudioVideo.VoiceXml.Browser voiceXmlBrowser = null;
        voiceXmlBrowser = new Microsoft.Rtc.Collaboration.AudioVideo.VoiceXml.Browser();
        vxmlDirectory = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "Voicexml");
        string vxmlURL = Path.Combine(vxmlDirectory, menuName.Trim().Replace(" ", "_") + ".vxml");
        Uri pageURI = new Uri(vxmlURL);
        voiceXmlBrowser.RunAsync(pageURI, null);
    }

When voiceXmlBrowser.RunAsync(pageURI, null); line hits, then it throws exception above mentioned.

Following is stack trace
"Specified method is not supported."
at Microsoft.Rtc.Collaboration.AudioVideo.SpeechSynthesisConnector.Seek(Int64 offset, SeekOrigin origin)
at Microsoft.Speech.Synthesis.WaveOutputStream.Seek(Int64 offset, SeekOrigin origin)
at Microsoft.Speech.Internal.SapiInterop.SpStreamWrapper.Seek(Int64 offset, Int32 seekOrigin, IntPtr plibNewPosition)


Solution

  • It doesn't look like your voiceXmLBrowser has been connected to a call. Try calling voiceXmlBrowser.SetAudioVideo(myAudioVideoCall) before RunAsync.