Example #1
0
        // MRCP connection established, start communication
        public override bool OnAdd(UniMRCPSigStatusCode status)
        {
            if (status != UniMRCPSigStatusCode.SUCCESS)
            {
                return(Fail(String.Format("Failed to add channel: {0}", status)));
            }
            // Start processing here
            UniMRCPSynthesizerMessage msg = CreateMessage(UniMRCPSynthesizerMethod.SYNTHESIZER_SPEAK);

            msg.content_type = "text/plain";
            msg.SetBody(text);
            return(msg.Send());
        }
Example #2
0
        // MRCP connection established, start communication
        public override bool OnAdd(UniMRCPSigStatusCode status)
        {
            if (status != UniMRCPSigStatusCode.SUCCESS)
            {
                return(Fail(String.Format("Failed to add channel: {0}", status)));
            }
            // Load grammar content from file
            byte[] content = File.ReadAllBytes(grammarFile);
            // Start processing here
            UniMRCPRecognizerMessage msg = CreateMessage(UniMRCPRecognizerMethod.RECOGNIZER_RECOGNIZE);

            msg.content_type = "application/grammar+xml";
            msg.SetBody(content);
            return(msg.Send());
        }
Example #3
0
 public override bool OnTerminate(UniMRCPSigStatusCode status)
 {
     Console.WriteLine("Session terminated with code {0}", status);
     return(true);
 }
Example #4
0
 public override bool OnTerminate(UniMRCPSigStatusCode status)
 {
     Console.WriteLine("Session terminated with code {0}", status);
     return true;
 }
Example #5
0
 // MRCP connection established, start communication
 public override bool OnAdd(UniMRCPSigStatusCode status)
 {
     if (status != UniMRCPSigStatusCode.SUCCESS)
         return Fail(String.Format("Failed to add channel: {0}", status));
     // Start processing here
     UniMRCPSynthesizerMessage msg = CreateMessage(UniMRCPSynthesizerMethod.SYNTHESIZER_SPEAK);
     msg.content_type = "text/plain";
     msg.SetBody(text);
     return msg.Send();
 }
Example #6
0
 // MRCP connection established, start communication
 public override bool OnAdd(UniMRCPSigStatusCode status)
 {
     if (status != UniMRCPSigStatusCode.SUCCESS)
         return Fail(String.Format("Failed to add channel: {0}", status));
     // Load grammar content from file
     byte[] content = File.ReadAllBytes(grammarFile);
     // Start processing here
     UniMRCPRecognizerMessage msg = CreateMessage(UniMRCPRecognizerMethod.RECOGNIZER_RECOGNIZE);
     msg.content_type = "application/grammar+xml";
     msg.SetBody(content);
     return msg.Send();
 }