Esempio n. 1
0
        static void Main(string[] args)
        {
            int socket;
            if (args.Length < 2)
            {
                Console.WriteLine("Needs a parameter for Streaming Socket");
                return;
            }
            else
            {
                socket = Convert.ToInt32(args[1]);
                if (socket < 0 || socket > 65535)
                {
                    Console.WriteLine("Socket must be in range 0 - 65535");
                    return;
                }
            }
            KinectSensor kinect = KinectSensor.KinectSensors[0];

            kinect.SkeletonStream.Enable();
            kinect.Start();

            SkeletonListener skeletonListener = new SkeletonListener(kinect, socket);
            skeletonListener.Start();
            while (true)
            {
            }
        }
Esempio n. 2
0
		public void Start()
		{
			if(KinectSensor.KinectSensors.Count == 0)
			{
				Debug.WriteLine("No Kinects found.");
				Environment.Exit(-1);
			}

			_kinect = KinectSensor.KinectSensors[0];

			_kinect.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
			_kinect.DepthStream.Enable(DepthImageFormat.Resolution320x240Fps30);
			_kinect.SkeletonStream.Enable();

			_kinect.Start();

			_colorListener = new ColorListener(_kinect, ColorPort, ImageFormat.Jpeg);
			_colorListener.Start();

			_depthListener = new DepthListener(_kinect, DepthPort);
			_depthListener.Start();

			_skeletonListener = new SkeletonListener(_kinect, SkeletonPort);
			_skeletonListener.Start();

			_audioListener = new AudioListener(_kinect, AudioPort);
			_audioListener.Start();

			IPAddress[] addresses = Dns.GetHostAddresses(Dns.GetHostName());
			string s = string.Empty;
			foreach(IPAddress address in addresses)
				s += Environment.NewLine + address;

			Debug.WriteLine("Waiting for client on..." + s);
		}
Esempio n. 3
0
        static void Main()
        {
            while(KinectSensor.KinectSensors.Count == 0)
            {
                Console.WriteLine("Please insert a Kinect sensor and press any key to continue.");
                Console.ReadKey();
            }

            _kinect = KinectSensor.KinectSensors[0];

            _kinect.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
            _kinect.DepthStream.Enable(DepthImageFormat.Resolution320x240Fps30);
            _kinect.SkeletonStream.Enable();

            _kinect.Start();

            _videoListener = new ColorListener(_kinect, VideoPort, ImageFormat.Jpeg);
            _videoListener.Start();

            _depthListener = new DepthListener(_kinect, DepthPort);
            _depthListener.Start();

            _skeletonListener = new SkeletonListener(_kinect, SkeletonPort);
            _skeletonListener.Start();

            _audioListener = new AudioListener(_kinect, AudioPort);
            _audioListener.Start();

            IPAddress[] addresses = Dns.GetHostAddresses(Dns.GetHostName());
            string s = string.Empty;
            foreach(IPAddress address in addresses)
                s += Environment.NewLine + address;

            Console.WriteLine("Waiting for client on..." + s);

            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();

            if(_depthListener != null)
                _depthListener.Stop();

            if(_videoListener != null)
                _videoListener.Stop();

            if(_skeletonListener != null)
                _skeletonListener.Stop();

            if(_audioListener != null)
                _audioListener.Stop();
        }