/// <summary> /// Mic array beam directin changed event handler /// </summary> /// <param name="beamDirectionChanged"></param> private void BeamDirectionChangedHandler(sr.BeamDirectionChanged beamDirectionChanged) { // Keep speech event queue from growing infinitely if (this.state.SpeechEvents.Count == MaxSpeechEventsToRetain) { this.state.SpeechEvents.RemoveAt(0); } // Add latest event to queue this.state.SpeechEvents.Add(new EventListEntry(beamDirectionChanged.Body)); }
/// <summary> /// Mic array beam direction changed event handler /// </summary> /// <param name="beamDirectionChanged"></param> private void BeamDirectionChangedHandler(sr.BeamDirectionChanged beamDirectionChanged) { // KinectAudioSource.BeamAngle Property // Gets the beam angle (in degrees), which is the direction the audio beam is pointing. // The center value is zero, negative values are right of the Kinect device (left of user), and positive values are left of the Kinect device (right of user). int angle = Direction.to180fromRad(-beamDirectionChanged.Body.Angle); Tracer.Trace("beam direction changed at " + angle); // register the fact: _state.SoundBeamDirection = angle; _state.SoundBeamTimeStamp = DateTime.Now; //setPan(angle); //setTilt(0); }