Exemple #1
0
        void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            //throw new NotImplementedException();

            switch (CurrentJob)
            {
            case JOb.recognise1:
                dataPipe = VoiceText.RecordText(5);
                break;

            case JOb.recognise2:
                dataPipe = VoiceText.RecordText(5);
                break;

            case JOb.addissue:
                redmine.rIssue issue = new redmine.rIssue()
                {
                    ProjectId   = projidPipe,
                    TrackerId   = trackidPipe,
                    Title       = IssueTitleText.Text,
                    Description = textBox1.Text
                };
                issuecreated = issue.Create();
                break;

            default:
                break;
            }
        }
Exemple #2
0
    IEnumerator transVoiceData_(VoiceTextData voideData, Action <VoiceTextData> endCb)
    {
        bool bIsHololens = false;

#if WINDOWS_UWP
        bIsHololens = (Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Holographic");
#endif
        var fromLang = "ja";
        var toLang   = "en";
        if (bIsHololens)
        {
            fromLang = "en";
            toLang   = "ja";
        }
        yield return(TranslatorTest(fromLang, toLang, voideData.voiceDictText, (isOk, text) =>
        {
            if (isOk)
            {
                voideData.voiceTransText = text;
            }
            else
            {
                voideData.voiceTransText = "翻訳失敗:" + text;
            }
            endCb(voideData);
        }));
    }
Exemple #3
0
    void uiTextUpdate_()
    {
        inputVoiceText.Length = 0;
        transVoiceText.Length = 0;
        //inputVoiceRtText.Length=0;
        inputAndTransVoiceRtText.Length = 0;

        //処理済みのデータ
        {
            var startIdx = resutVoiceTextList_.Count > 10 ? resutVoiceTextList_.Count - 10 : 0;
            for (int idx = startIdx; idx < resutVoiceTextList_.Count; idx++)
            {
                var voiceData = resutVoiceTextList_[idx];
                inputVoiceText.AppendLine("");
                inputVoiceText.AppendLine(voiceData.voiceDictText + " =>");
                inputVoiceText.AppendLine(voiceData.voiceTransText + " | ");
            }
        }
        //処理中・処理待ちのデータ
        {
            var data = voiceTextQueue_.ToArray();
            foreach (var voiceData in voiceTextQueue_)
            {
                inputVoiceText.Append(voiceData.voiceDictText + " => ");
                inputVoiceText.AppendLine(voiceData.voiceTransText + " | ");
            }
        }
        {
            VoiceTextData lastDat = null;
            if (resutVoiceTextList_.Count > 0)
            {
                lastDat = resutVoiceTextList_[resutVoiceTextList_.Count - 1];
            }

            //リアルタイム受付翻訳中のデータ
            {
                //inputAndTransVoiceRtText.AppendLine(realTimeDictText);
                //inputAndTransVoiceRtText.AppendLine(realTimeTransText);
            }

            //音声入力中のデータ
            {
                //if (lastDat != null) inputAndTransVoiceRtText.Append(lastDat.voiceDictText + "\n");

                inputAndTransVoiceRtText.Append(nowDictationText_);
                inputAndTransVoiceRtText.Append("\n(" + realTimeTransText + ")");

                //if (lastDat != null) inputAndTransVoiceRtText.Append("\n(" + lastDat.voiceTransText + ")");

                //inputVoiceRtText.Append(nowDictationText_);
            }
        }

        //表示処理
        {
            // 末端の改行除去します
            if (inputVoiceText.Length > 2 && inputVoiceText[inputVoiceText.Length - 1] == '\n')
            {
                inputVoiceText.Remove(inputVoiceText.Length - 2, 2);
            }
            if (transVoiceText.Length > 2 && transVoiceText[transVoiceText.Length - 1] == '\n')
            {
                transVoiceText.Remove(transVoiceText.Length - 2, 2);
            }

            uiText_inputVoiceRealtime.alignment = TextAnchor.MiddleRight;
            uiText_transVoiceRealtime.alignment = TextAnchor.MiddleRight;

            // UIにテキストを反映します
            uiText_inputVoice.text = inputVoiceText.ToString();
            uiText_transVoice.text = transVoiceText.ToString();
            //uiText_inputVoiceRealtime.text = inputVoiceRtText.ToString();
            uiText_transVoiceRealtime.text = inputAndTransVoiceRtText.ToString();
        }
    }