void Start() { if ((Options.mode & PXCUPipeline.Mode.VOICE_RECOGNITION) == 0) { options.SetMessage("Instructions: Show one of your hands to the camera, " + "and use \"closure + openness of Thumb Finger and Index Finger\" to create the KnifeRay to cut the fruits.\n\n" + "GoldApple gives you 20 points, while other fruit gives 1 point.\n" + "Accoring to the different angles of you KnifeRay, there are three Splashs." + "Every object has a different color of splash.\n\n" + "Challenge: Cutting the Fruit and Hamster with Gesture is a bit difficult.\n\n" + "Tips: Don't cut the Hamster, it will cause you lose 1 life."); return; } pp = new PXCUPipeline(); if (!pp.Init(PXCUPipeline.Mode.VOICE_RECOGNITION)) { options.SetMessage("Failed to initialize PXCUPipeline for voice recognition"); return; } /* It's critical to set the volume for recognition because the camera is very sensitive */ float[] volume = new float[1] { 0.2f }; pp.SetDeviceProperty(PXCMCapture.Device.Property.PROPERTY_AUDIO_MIX_LEVEL, volume); stop = false; line = null; thread = new Thread(ThreadRoutine); thread.Start(); }
void Start() { PV = gameObject.GetComponent<PerCVoice>(); myPipe = new PXCUPipeline(); commandsSet = myPipe.SetVoiceCommands(commands); if(!commandsSet)Debug.Log("Failed to set Commands! :'("); if(!myPipe.Init(myMode) || !commandsSet){ Debug.LogError("Failed To initialize PipeLine OH NOES!"); initiated = false; return; } else {initiated = true; myPipe.SetDeviceProperty(audio_mix_prop,volume);}//must choose a volume that handles the environment, sensitive mic //default the bool arrays to false. numbers = new bool[10]; options = new bool[commands.Length-10]; for(int i = 0; i<numbers.Length;i++)numbers[i] = false; for(int j = 0; j<options.Length;j++)options[j] = false; keepLooping = true;//tell the thread not to stop dictated = null; myThread = new Thread(ThreadFunc);//make thread handle myThread.Start(); //let 'er rip! }