当前位置: 首页>>代码示例>>C#>>正文


C# Port.open方法代码示例

本文整理汇总了C#中Port.open方法的典型用法代码示例。如果您正苦于以下问题:C# Port.open方法的具体用法?C# Port.open怎么用?C# Port.open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Port的用法示例。


在下文中一共展示了Port.open方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: openSender

        /// <summary>
        /// 
        /// </summary>
        /// <param name="namePort"></param>
        public void openSender(string namePort) 
        {
            if (!String.IsNullOrEmpty(namePort))
            {
                Network.init();
                outPort = new Port();
                outPort.open(namePort);
            }

        }
开发者ID:FACE-Team,项目名称:FACETools,代码行数:14,代码来源:YarpPort.cs

示例2: SpeechRecognizerServer

        public SpeechRecognizerServer(string moduleName)
        {
            System.Collections.ObjectModel.ReadOnlyCollection<RecognizerInfo> installedRecognizers = SpeechRecognitionEngine.InstalledRecognizers();

            //Synchronous Recognition
            m_reco = new System.Speech.Recognition.SpeechRecognitionEngine(myLanguage);

            Network.init();
            m_moduleName = moduleName;

            //TTS
            m_tts = new System.Speech.Synthesis.SpeechSynthesizer();
            m_portISpeak = new Port();
            m_portISpeak.open("/" + moduleName + "/tts/iSpeak:o");
            Network.connect("/" + moduleName + "/tts/iSpeak:o", "/iSpeak");

            //Grammars
            GrammarBuilder dictation = new GrammarBuilder();
            dictation.Culture = myLanguage;
            dictation.AppendDictation();
            m_grammar_dictation = new Grammar(dictation);
            GrammarBuilder spelling = new GrammarBuilder();
            spelling.Culture = myLanguage;
            spelling.AppendDictation("spelling");
            m_grammar_dictation_spelling = new Grammar(spelling);
            m_grammar_continuous = new GrammarBuilder("For sure this non empty grammar will never be recognized.");

            m_reco.SetInputToDefaultAudioDevice();
            m_reco.LoadGrammar(m_grammar_dictation);

            //Continuous Recognition
            m_reco_continuous = new SpeechRecognitionEngine();
            m_reco_continuous.SetInputToDefaultAudioDevice();
            m_portContinuousRecognition = new Port();
            m_portContinuousRecognition.open("/" + moduleName + "/recog/continuous:o");
            m_reco_continuous.LoadGrammar(new Grammar(m_grammar_continuous));
            m_reco_continuous.RecognizeCompleted += onContinuousRecognitionResult;
            m_reco_continuous.RecognizeAsync();

            m_grammarManager = new RobotGrammarManager();
            m_grammarManager.InitialiseVocabulories();
            SetLanguage("EN-us");
            //SetLanguage("fr-fr");

            Console.WriteLine("#########################");
            Console.WriteLine("#    Speech Recognizer  #");
            Console.WriteLine("#########################");

            Network.init();
            m_rpcPort = new Port();
            m_rpcPort.open("/" + m_moduleName + "/rpc");
            m_rpcThread = new System.Threading.Thread(HandleRPC);
            m_rpcThread.Start();
        }
开发者ID:xufango,项目名称:contrib_bk,代码行数:54,代码来源:SpeechRecognizerServer.cs

示例3: openConnectionToDb

        /// <summary>
        /// 
        /// </summary>
        /// <param name="nameOutputPort"></param>
        /// <param name="namePortDb"></param>
        /// <returns></returns>
        public bool openConnectionToDb(string nameOutputPort, string namePortDb)
        {
            if (!String.IsNullOrEmpty(namePortDb) && !String.IsNullOrEmpty(nameOutputPort))
            {
                Network.init();

                outPort = new Port();
                outPort.open(nameOutputPort);

                style = new ContactStyle();
                style.persistent = true;

                if (PortExists(namePortDb))
                {
                    //if (Network.isConnected(nameOutputPort, namePortDb, style))
                        Network.disconnect(nameOutputPort, namePortDb,style);

                        if (Network.connect(nameOutputPort, namePortDb, style))
                    {
                        Console.WriteLine(namePortDb + " port is connected to " + nameOutputPort);
                        return true;
                    }
                    else
                        return false;
                }
                else
                    return false;

            }
            else
                return false;
        }
开发者ID:FACE-Team,项目名称:FACETools,代码行数:38,代码来源:YarpPort.cs


注:本文中的Port.open方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。