Пример #1
0
 public PaEngine(PaConfig config)
 {
     myConfig = config;
 }
Пример #2
0
        private void DoAnalysis()
        {
            MaoriObj word = GetSelectedMaoriObj(MaoriObjType.Word);

            PaConfig config = new PaConfig()
            {
                currentWord = word.Name,
                AnnieDir = ResMan.GetAnnieDir(),
                batFilePath = ResMan.GetAnnieDir() + "\\Process.bat",
                audioList = recordedWavFiles
            };

            PaEngine engine = new PaEngine(config);
            if (engine.wavFilesOK())
            {
                // The Main thread will wait until the process finishes
                engine.Start();

                //listBoxREC.Items.Add(engine.GetRecognizedWord());
                listREC.Add(engine.GetRecognizedWord());
                RefreshListRecBox();

                //copies the user recording files to the HTML report resource folder
                HtmlConfig hConfig = new HtmlConfig(systemIO.GetAppDataDir(allUsers.getCurrentUser()));
                ResMan.SuperCopy(CurrentVoicePath,
                          hConfig.GetRecPath(listREC.Count,
                          HtmlConfig.pathType.fullUserRecPath), true);

                //prepare to copy the sample recording file to the HTML report res folder

                //make sure the sample recording is different from each other
                string soundToPlay = null;
                int counter = 0;
                do
                {
                    counter += 1;
                    soundToPlay = ResMan.GetWordSound(GetAudioSource(), word.WordSoundId, true);
                    if (soundToPlay == null)
                        break;
                } while ((soundToPlay == lastPlayedSound) && (counter < 255));

                lastPlayedSound = soundToPlay;

                //copies the sample recording files to the HTML res folder
                ResMan.SuperCopy(soundToPlay, hConfig.GetRecPath(listREC.Count,
                    HtmlConfig.pathType.fullSampleRecPath), true);

                //change the UI
                buttonShowReport.Enabled = true;
                ReportPath = engine.GetReportPath();
            }

            ResetRecordings();
        }