Share via


Data Streams

Kinect for Windows 1.5, 1.6, 1.7, 1.8

If enabled, a Kinect can capture audio, color, and depth data, and process the depth data to generate skeleton data. The sensor provides the data to your application in the form of a data stream. The NUI API lets you programmatically control and access all four of the data streams.

To avoid dropping frames, ensure that your application processes and releases each frame in a timely fashion. When initializing the NUI API, the application needs to:

  • Identify which streams are needed
  • Open each stream
  • Preallocate buffers to hold sensor data
  • Get the new data for each stream each frame
  • Release the buffer so that the runtime can fill it with the next frame

To make sure a buffer does not get overwritten with the next frame before the previous frame has been used, an application typically uses multiple buffers per frame for each stream. An application can request up to four buffers; two is adequate for most usage scenarios. If the runtime fills all the buffers before the application retrieves and releases a frame, then the runtime discards the oldest frame and reuses that buffer. As a result, it is possible for frames to be dropped.

In This Section