internal static IRecognizerMachine CreateRecognizer(string recognizerType, int amplification, int secondsToAnalyzeAudioFiles)
        {
            IRecognizerMachine recognizerMachine = null;

            if (recognizerType == ItemToRecognizerTypeMap.RecognizerType[2])
            {
                recognizerMachine = new PopsRecognizer(amplification, secondsToAnalyzeAudioFiles);
            }
            else if (recognizerType == ItemToRecognizerTypeMap.RecognizerType[1])
            {
                recognizerMachine = new SpecificSoundRecognizer(amplification, secondsToAnalyzeAudioFiles);
            }

            return(recognizerMachine);
        }
Exemplo n.º 2
0
        private void ScanItem()
        {
            mMicrowaveItemInfo = mScanner.Scan() as MicrowaveItemInfo;
            if (mMicrowaveItemInfo != null)
            {
                mRecognizer = MachineRecognizerFactory.CreateRecognizer(
                    (mScanner as ItemScanner).ItemToRecognizerTypeMap.
                    GetRecognizerTypeByItem(mMicrowaveItemInfo),
                    10,
                    10);

                if (mRecognizer != null)
                {
                    mRecognizer.RecognizerFinished += SetShouldStopStatus;
                    string itemCategory = (mScanner as ItemScanner).
                                          ItemToRecognizerTypeMap.GetRecognizerTypeByItem(mMicrowaveItemInfo);
                    mRecognizer.LoadProcessedData(itemCategory);
                }
            }
        }
Exemplo n.º 3
0
        internal static IRecognizerMachine CreateRecognizer(
            string workingDirectoryPath,
            string recognizerType)
        {
            IRecognizerMachine recognizerMachine = null;

            if (recognizerType == ItemToRecognizeDataMap.RecognizerType[2])
            {
                recognizerMachine = new PopsRecognizer(workingDirectoryPath);
            }
            else if (recognizerType == ItemToRecognizeDataMap.RecognizerType[1])
            {
                int amplification = 10;
                int secondsToAnalyzeAudioFiles = 10;

                recognizerMachine = new SpecificSoundRecognizer(
                    workingDirectoryPath,
                    amplification,
                    secondsToAnalyzeAudioFiles);
            }

            return(recognizerMachine);
        }