Esempio n. 1
0
 // Use this for initialization
 void Start()
 {
     i_sensor = KinectSensor.GetDefault();
     if (i_sensor != null)
     {
         if (!i_sensor.IsOpen)
         {
             i_sensor.Open();
         }
         Windows.Kinect.AudioSource l_as = i_sensor.AudioSource;
         i_reader = l_as.OpenReader();
         //l_as.AudioBeams[0].AudioBeamMode = AudioBeamMode.Manual;
         //l_as.AudioBeams[0].BeamAngle = 0;
     }
 }
    void Start()
    {
        Kinect2Interface sensorInterface = KinectManager.Instance.GetSensorData().sensorInterface as Kinect2Interface;

        Windows.Kinect.KinectSensor kinectSensor = sensorInterface != null ? sensorInterface.kinectSensor : null;

        if (kinectSensor != null)
        {
            this.audioSource = kinectSensor.AudioSource;
            this.audioReader = audioSource.OpenReader();

            Debug.Log("AudioSource IsActive: " + audioSource.IsActive);

            if (audioReader != null)
            {
                Debug.Log("KinectAudio successfully initialized.");
            }
            else
            {
                Debug.Log("KinectAudio initialization failed.");
            }
        }
    }