Skip to content

Kinect Studio can’t connect to my app! (fix your elevation levels)

Kinect Developer:

I have a .NET 4.0 application which is loading a dll which is loading the Microsoft.Kinect.dll. Independent of the time when I start my application (before Kinect Studio or afterwards) it is not recognized. What gives?

Known issue!

From the doc page (Connecting to a Kinect-enabled Application [Kinect Studio])

Permissions

You must run a Kinect for Windows application and Kinect Studio with the same permissions level. For example, if you launch an application with elevated permissions (such as administrator), you must launch Kinect Studio with the same elevated permissions to connect to the application.

Visual Studio has similar issues (causing you to relaunch and elevate VS if the app is elevated) when attempting to attach to a process.

Kinect Studio has the disadvantage that the list of Kinect using apps that we show to attach to an application is determined by looking for the loading of a DLL into their process.  If Kinect Studio wasn’t run in an elevated mode, it won’t have permissions to check that process for that loaded dll.

Hope that helps!

-Rob

[Applies to v1.5.0 of Kinect Studio – the only version as of this date]

Kinect for Windows v1.5 Released – 2012/05/12

Happy to be back with details of our SDK and Developer Toolkit v1.5. They are downloadable now.

We hope you enjoy!

Stay tuned to more info from our team: our team blog, @KinectWindows
and from me: this blog, @rrelyea

-Rob Relyea, @rrelyea
Program Manager, Kinect for Windows team

Blogging from win8 app onto WordPress blog

I am testing an update to the win8 WordPress metro app. It has been updated to support posting to WordPress blogs. Sitting on the couch, dog and son next to me, watching mariners play with white sox.
Using win8 consumer preview on win7 era Acer iconia tab w500.
Nice…but this typing experience without a keyboard is more appropriate for twitter than blogging.
 
That said, I am very impressed by the on screen keyboard in win8!
 
 

Kinect for Windows – Details of API Changes from Beta2 to v1.0 (C#/VB)

[This article covers the details of changes of C#/VB accessible
APIs. Please ensure you read the code
migration post
as well.]

Namespace and Assembly Name Changes

Since our Beta 1 (June 2011) release of the Kinect for
Windows SDK , our C#/VB  accessible APIs have been provided via
Microsoft.Research.Kinect.dll. The public Types all were organized into 2 namespaces:
Microsoft.Research.Kinect.Nui and Microsoft.Research.Kinect.Audio.
Our team made the decision back in early 2011 that we would mark our beta
releases of APIs as “Research” to indicate the fact that this was an early
version of our APIs, created in concert with Microsoft Research.

On February 1, 2012, we released our final v1.0 SDK. In that
release, our DLL is now called Microsoft.Kinect.dll. All of our public APIs are
in the Microsoft.Kinect namespace.

Release

Assembly Names

Namespaces

Beta 2 (November 2011)

Microsoft.Research.Kinect.dll

Microsoft.Research.Kinect.Nui

Microsoft.Research.Kinect.Audio

V1.0 (Feb 2012)

Microsoft.Kinect.dll

Microsoft.Kinect

Runtime type (Rename to KinectSensor, refactoring)

Significant changes:

KINECTSENSOR API – SUMMARY OF API
CHANGES/REMOVALS/ADDITIONS

<NamespaceOldName=Microsoft.Research.Kinect.NuiName=Microsoft.Kinect>

    <TypeOldName=RuntimeName=KinectSensor>

        <MemberOldName=KinectsName=KinectSensors />

        <MemberOldName=InitializeName=Start />

        <MemberOldName=UninitializeName=Stop />

        <MemberName=DisposeAdded=True />

 

        <MemberOldName=VideoStreamName=ColorStream />

        <MemberOldName=VideoFrameReadyName=ColorFrameReady />

 

        <MemberOldName=SkeletonEngine
Name=SkeletonStream />

 

        <MemberName=AllFramesReady
Added=True />

 

        <MemberName=InstanceIndex
Removed=True />

        <MemberOldName=InstanceNameName=DeviceConnectionId />

        <MemberName=UniqueKinectId
Added=True />

 

        <MemberName=NuiCameraRemoved=True/>

        <MemberOldName=ElevationMaximumName=MaxElevationAngleMovedFrom=Camera />

        <MemberOldName=ElevationMinimumName=MinElevationAngleMovedFrom=Camera />

        <MemberName=ElevationAngle
MovedFrom=Camera />

 

        <MemberName=MapDepthFrameToColorFrameAdded=True />

        <MemberName=MapDepthToColorImagePointAdded=True />

        <MemberName=MapDepthToSkeletonPointAdded=True />

        <MemberName=MapSkeletonPointToDepthAdded=True />

        <MemberName=MapSkeletonPointToColorAdded=True />

    </Type>

    <TypeName=RuntimeOptionsRemoved=TrueMessage=Enable the streams from
the KinectSensor class.
/>

    <TypeOldName=KinectDeviceCollectionName=KinectSensorCollection>

        <MemberName=DisposeAdded=True />

    </Type>

    <TypeName=StatusChangedEventArgs>

        <MemberOldName=KinectRuntime
Name=Sensor />

    </Type>

    <TypeName=CameraRemoved=True>

        <MemberOldName=GetColorPixelCoordinatesFromDepthPixelName=MapToColorPixelMovedTo=DepthImageFrame />

        <MemberOldName=ElevationMaximumName=MaxElevationAngleMovedTo=KinectSensor />

        <MemberOldName=ElevationMinimumName=MinElevationAngleMovedTo=KinectSensor />

        <MemberName=ElevationAngle
MovedTo=KinectSensor />

    </Type>

    <TypeName=KinectStatus>

        <MemberName=UndefinedAdded=True />

        <MemberName=InitializingAdded=True />

        <MemberName=DeviceNotGenuineAdded=True />

        <MemberName=DeviceNotSupportedAdded=True />

        <MemberName=InsufficientBandwidthAdded=True />

    </Type>

</Namespace>

KinectSensor discovery

In beta2 (November 2011), we introduced a KinectSensors property on the Runtime object. We also
introduced a StatusChanged event.

In v1 (Feb 2012), those continue to be the key concepts to
understand when your program needs to work with 1 or more sensors.

It is critical that Kinect-enabled applications can deal
appropriately with the situations that users will hit with their application
(no Kinect sensor connected to computer, Kinect sensor is not powered by A/C
power, insufficient USB bandwidth, etc…)

Please read the documentation under “Programming
Guide/Kinect Sensor/Kinect-Enabled Application”:

Relevant samples (installed with SDK):

  • ShapeGame (C#/WPF) – KinectSensorChooser component
  • KinectAudioDemo (C#/WPF) – KinectSensorChooser component
  • KinectExplorer (C#/WPF)
  • SkeletonViewer (C++/Direct2D+GDI)

KinectSensor
initialization

Our beta APIs had a set of hard to understand and discover
API calls to configure the services you needed to get from the sensor. We
worked to make this part of our API more approachable. Our design goals were:

  • Enable a developer to ask once, not several
    times for a feature.
  • Valid settings are determinable via intellisense/compiling, not just runtime errors
  • Good default behavior.
  • Dynamic changing of any setting over time.

OLD CODE

EQUIVALENT NEW CODE

runtime.Initialize(RuntimeOptions.UseDepthAndPlayerIndex | RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseColor);

runtime.VideoStream.Open(ImageStreamType.Video, 2,
ImageResolution.Resolution640x480, ImageType.Color);

runtime.DepthStream.Open(ImageStreamType.Depth, 2,
ImageResolution.Resolution320x240, ImageType.DepthAndPlayerIndex);

kinectSensor.ColorStream.Enable();

kinectSensor.DepthStream.Enable();

kinectSensor.SkeletonStream.Enable();

kinectSensor.Start();

The old way doesn’t meet
many of our design goals for Initialization:

You needed to ask twice – once in Init() and once in Open().

  • Runtime errors were often are raised.
  • We had poor defaults; you had to ask for every setting.
  • We didn’t expose r/w properties for most of those settings, so you
    needed to re-init() and/or re-open() to set them to different values.
     

The ColorImageStream, DepthImageStream,
and SkeletonStream types also have ways to tweak
their behavior. Enable has some optional parameters, and those stream types
have several r/w properties as well.

Types/APIs to explore: KinectSensor, ColorImageStream, DepthImageStream,
SkeletonStream.

KinectSensor uninitialize

OLD CODE

NEW CODE

runtime.Uninitialize();

kinectSensor.Stop();

ColorImage API changes

Significant changes:

  • Reorganization of colorImage
    data. There is no longer a PlanarImage class.
  • Developer is now responsible for own allocations
    of pixelData variables and copying pixelData to that storage. (Color pixelData
    is still a byte array with same layout as beta2.)
  • This enables the Kinect Runtime to better reuse
    resources if an application’s data processing falls behind.
  • Availability of colorImage
    data during ColorFrameReady or AllFramesReady
    events. (AllFramesReady gives matching color, depth
    and/or skeleton frames.)

Relevant samples (installed with SDK):

  • KinectExplorer (C#/WPF) – KinectColorViewer component
  • SkeletonViewer (C++/Direct2D+GDI)
  • ShapeGame (C#/WPF) – KinectColorViewer component

COLORIMAGE API – SUMMARY OF
API CHANGES/REMOVALS/ADDITIONS

<TypeName=ColorImageStreamAdded=True>

    <MemberOldName=GetNextFrameName=OpenNextFrame />

    <MemberName=DisableAdded=True />

    <MemberOldName=OpenName=Enable />

    <MemberName=StreamTypeRemoved=True />

    <MemberName=ResolutionRemoved=True />

    <MemberName=TypeRemoved=True />

    <MemberOldName=HeightName=FrameHeight />

    <MemberOldName=WidthName=FrameWidth />

    <MemberName=CreateCompatibleImageFrameRemoved=True />

</Type>

<TypeName=ImageFrameReadyEventArgsRemoved=TrueMessage=Use ColorImageFrameReadyEventArgs or DepthImageFrameReadyEventArgs
instead of the now removed ImageFrameReadyEventArgs
>

</Type>

<TypeName=ColorImageFrameReadyEventArgsAdded=True>

    <MemberOldName=ImageFrameName=OpenColorImageFrame />

</Type>

<TypeName=ColorImageFrameAdded=True>

    <MemberName=TypeRemoved=True />

    <MemberName=ResolutionRemoved=True />

    <MemberName=ImageRemoved=True />

    <MemberName=ViewAreaRemoved=True />

    <MemberName=ImageFrameRemoved=True />

    <MemberName=BytesPerPixelMovedFrom=PlanarImage />

    <MemberName=HeightMovedFrom=PlanarImage />

    <MemberName=WidthMovedFrom=PlanarImage />

    <MemberOldName=BitsName=PixelDataMovedFrom=PlanarImage />

    <MemberName=CopyPixelDataTo />

    <MemberName=SourceStreamRemoved=True />

    <MemberName=PixelDataRemoved=TrueMessage=use CopyPixelDataTo(…)/>

    <MemberName=DisposeAdded=True />

</Type>

<TypeName=PlanarImageRemoved=TrueMessage=Data moved to ColorImageFrame/DepthImageFrame
/>

OLD CODE

runtime.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.Color);

 

runtime.VideoFrameReady += new
EventHandler<ImageFrameReadyEventArgs>(ColorImageReady);

 

void ColorImageReady(object sender, ImageFrameReadyEventArgs e)

{

    PlanarImage planarImage
= e.ImageFrame.Image;

 

    // DISPLAY OR PROCESS IMAGE DATA IN planarImage HERE

}

 

NEW CODE

kinectSensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);

 

kinectSensor.ColorFrameReady += new
EventHandler<ColorImageFrameReadyEventArgs>(ColorImageReady);

byte[] pixelData;

 

void ColorImageReady(object sender, ColorImageFrameReadyEventArgs e)

{

    bool receivedData
= false;

    using (ColorImageFrame colorImageFrame = e.OpenColorImageFrame())

    {

        if (colorImageFrame != null)

        {

            if
(pixelData == null)
//allocate the first time

            {

                pixelData
= new byte[colorImageFrame.PixelDataLength];

            }

            colorImageFrame.CopyPixelDataTo(pixelData);

            receivedData
= true;

        }

        else

        {

            // apps
processing of image data is taking too long, it got
more than 2 frames behind.

            // the
data is no longer avabilable.

        }

    }

    if (receivedData)

    {

        // DISPLAY
OR PROCESS IMAGE DATA IN pixelData HERE

    }

}

 

DepthImage API changes

Significant changes:

  • Reorganization of depthImage data. There is no longer a PlanarImage class.
  • DepthPixel data is now a short[], instead of a byte[]. (Still 2 bytes of data representing each pixel.)
  • DepthPixel bit layout is now consistent, regardless if you have opted for Depth+Player or just Depth.
  • There is no longer a need to ask for Depth+Player or Depth. If the SkeletonStream is enabled, you get Depth+Player.
  • Developer is now responsible for own allocations of pixelData variables and copying pixelData to that storage.

This enables the Kinect Runtime to better reuse resources if an application’s data processing falls behind.

  • Availability of depthImage data during DepthFrameReady or AllFramesReady
    events. (AllFramesReady gives matching color, depth and/or skeleton frames.)

Relevant samples (installed with SDK):

    • KinectExplorer (C#/WPF) – KinectDepthViewer component
    • SkeletonViewer (C++/Direct2D+GDI)

DEPTHIMAGE API – SUMMARY OF
API CHANGES/REMOVALS/ADDITIONS

<TypeName=ImageFrameReadyEventArgsRemoved=TrueMessage=Use ColorImageFrameReadyEventArgs or DepthImageFrameReadyEventArgs
instead of the now removed ImageFrameReadyEventArgs
>

</Type>

<TypeName=DepthImageStreamAdded=True>

    <MemberOldName=GetNextFrameName=OpenNextFrame />

    <MemberName=IsTooFarRangeEnabled  Added=True/>

    <MemberName=DisableAdded=True />

    <MemberOldName=OpenName=Enable />

    <MemberName=StreamTypeRemoved=True />

    <MemberName=ResolutionRemoved=True />

    <MemberName=TypeRemoved=True />

    <MemberOldName=HeightName=FrameHeight />

    <MemberOldName=WidthName=FrameWidth />

    <MemberName=CreateCompatibleImageFrameRemoved=True />

</Type>

<TypeName=DepthImageFrameReadyEventArgsAdded=True>

    <MemberOldName=ImageFrameName=OpenDepthImageFrame />

</Type>

<TypeName=DepthImageFrameAdded=True>

    <MemberOldName=GetColorPixelCoordinatesFromDepthPixelName=MapToColorImagePointMovedFrom=DepthImageFrame />

    <MemberOldName=SkeletonToDepthImageName=MapFromSkeletonPointMovedFrom=SkeletonStream />

    <MemberOldName=DepthImageToSkeletonName=MapToSkeletonPointMovedFrom=SkeletonStream />

    <MemberName=PlayerIndexBitmaskAdded=True />

    <MemberName=PlayerIndexBitmaskWidthAdded=True />

</Type>

<TypeName=PlanarImageRemoved=TrueMessage=Data moved to ColorImageFrame/DepthImageFrame
/>

<TypeName=ImageDigitalZoomRemoved=True />

<TypeName=ImageStreamTypeRemoved=True />

<TypeName=ImageTypeRemoved=True />

<TypeName=ImageResolutionRemoved=True />

<TypeName=PlanarImageRemoved=TrueMessage=Data moved to ColorImageFrame/DepthImageFrame
/>

<TypeName=ImageViewArea
Removed=True />

<TypeName=DepthImageFormat  Added=True/>

<TypeName=DepthRange  Added=True/>

<TypeName=DepthImagePointAdded=True />

<TypeName=DepthImagePointFloatAdded=True />

OLD CODE

runtime.DepthStream.Open(ImageStreamType.Depth, 2, ImageResolution.Resolution320x240,

                     ImageType.DepthAndPlayerIndex);

 

runtime.DepthFrameReady += new
EventHandler<ImageFrameReadyEventArgs>(DepthImageReady);

 

private void
DepthImageReady(object
sender, ImageFrameReadyEventArgs
e)

{

    PlanarImage planarImage
= e.ImageFrame.Image;

 

    // DISPLAY OR
PROCESS IMAGE DATA IN pixelData HERE

}

NEW CODE

kinectSensor.DepthStream.Enable(DepthImageFormat.Resolution320x240Fps30);

 

kinectSensor.DepthFrameReady += new
EventHandler<DepthImageFrameReadyEventArgs>(DepthImageReady);

short[] pixelData;

 

private void
DepthImageReady(object
sender, DepthImageFrameReadyEventArgs
e)

{

    bool receivedData
= false;

    using (DepthImageFrame depthImageFrame = e.OpenDepthImageFrame())

    {

        if (depthImageFrame != null)

        {

            if (pixelData == null) //allocate the first time

            {

                pixelData
= new short[depthImageFrame.PixelDataLength];

            }

            depthImageFrame.CopyPixelDataTo(pixelData);

            receivedData
= true;

        }

        else

        {

            // apps
processing of image data took too long; it got more than 2 frames behind.

            // the
data is no longer avabilable.

        }

    }

    if (receivedData)

    {

        // DISPLAY
OR PROCESS IMAGE DATA IN pixelData HERE

    }

}

 

Skeleton API improvements

Significant changes:

  • Renamed SkeletonEngine -> SkeletonStream
  • Renamed SkeletonData -> Skeleton
  • Renamed JointID -> Joint
  • Renamed JointsCollection -> JointCollection
  • Renamed Vector -> SkeletonPoint
  • Renamed SkeletonQuality -> FrameEdges
  • Developer is now responsible for own allocations of skeleton array variables and copying skeletons to that storage.

This enables the Kinect Runtime to better reuse
resources if an application’s data processing falls behind.

  • Availability of skeleton data during SkeletonFrameReady or AllFramesReady
    events. (AllFramesReady gives matching color, depth
    and/or skeleton frames.)
  • New SkeletonStream.AppChoosesSkeletons  property + ChooseSkeletons() methods.

Relevant samples (installed with SDK):

  • KinectExplorer (C#/WPF) – KinectSkeletalViewer component
  • SkeletonViewer (C++/Direct2D+GDI)
  • ShapeGame (C#/WPF)

SKELETON API – SUMMARY OF API
CHANGES/REMOVALS/ADDITIONS

<TypeOldName=SkeletonEngine
Name=SkeletonStream>

    <MemberName=DisableAdded=True />

    <MemberName=EnableAdded=True />

    <MemberName=ChooseSkeletonsAdded=True />

    <MemberOldName=GetNextFrameName=OpenNextFrame />

    <MemberName=DepthImageToSkeletonMovedTo=DepthImageFrame />

    <MemberName=SkeletonToDepthImageMovedTo=DepthImageFrame />

</Type>

<TypeName=SkeletonFrameReadyEventArgs>

    <MemberOldName=SkeletonFrame
Name=OpenSkeletonFrame />

</Type>

<TypeName=SkeletonFrame>

    <MemberOldName=TimeStampName=Timestamp />

    <MemberOldName=SkeletonsName=CopySkeletonDataTo />

    <MemberName=DisposeAdded=True />

    <MemberName=QualityRemoved=True />

</Type>

<TypeOldName=SkeletonDataName=Skeleton >

    <MemberOldName=TrackingIDName=TrackingId />


<
MemberName=CountRemoved=True />

</Type>

<TypeName=JointTypeAdded=True/>

<TypeOldName=JointIDName=Joint>

    <MemberOldName=IDName=JointType />

    <MemberOldName=VectorName=Position />

    <MemberName=ParentRemoved=True />

</Type>

<TypeOldName=JointsCollectionName=JointCollection />

<TypeOldName=VectorName=SkeletonPoint>

    <MemberName=WRemoved=True />

</Type>

<TypeOldName=SkeletonQualityName=FrameEdges>

    <MemberOldName=ClippedLeftName=Left />

    <MemberOldName=ClippedTopName=Top />

    <MemberOldName=ClippedRightName=Right />

    <MemberOldName=ClippedBottom
Name=Bottom />

    <MemberName=NoneAdded=True />

</Type>

<TypeName=SkeletonFrameQualityRemoved=True />

OLD CODE

runtime.SkeletonFrameReady += new
EventHandler<SkeletonFrameReadyEventArgs>(nui_SkeletonFrameReady);

 

private void
nui_SkeletonFrameReady(object
sender, SkeletonFrameReadyEventArgs
e)

{

    SkeletonFrame skeletonFrame
= e.SkeletonFrame;

 

}

 

NEW CODE

kinectSensor.SkeletonFrameReady += new
EventHandler<SkeletonFrameReadyEventArgs>(nui_SkeletonFrameReady);

 

Skeleton[] skeletons;

 

private void
nui_SkeletonFrameReady(object
sender, SkeletonFrameReadyEventArgs
e)

{

    bool receivedData
= false;

    using (SkeletonFrame skeletonFrame = e.OpenSkeletonFrame())

    {

        if (skeletonFrame != null)

        {

            if
(skeletons == null) //allocate
the first time

            {

                skeletons = new Skeleton[skeletonFrame.SkeletonArrayLength];

            }

            receivedData
= true;

        }

        else

        {

            // apps
processing of skeleton data took too long; it got more than 2 frames behind.

            // the
data is no longer avabilable.

        }

    }

    if (receivedData)

    {

        // DISPLAY
OR PROCESS IMAGE DATA IN skeletons HERE

    }

}

 

Mapping API improvements (Skeleton
-> Depth, Depth -> Color)

Significant changes:

  • Moved these members to DepthImageFrame and KinectSensor
  • Added a new “entire frame” instead of per pixel function. (KinectSensor.MapDepthFrameToColorFrame)
  • Added a new Skeleton to Color method, which is similar to calling SkeletonToDepth and then DepthToColor.
  • The DepthImageFrame versions of these methods take fewer parameter, since
    it has the appropriate depthImage.
  • New return types: SkeletonPoint (replacing Vector) and DepthImagePoint (replacing 2 “out” parameters).

Relevant samples (installed with SDK):

  • KinectExplorer (C#/WPF) –KinectSkeletalViewer component
  • SkeletonViewer (C++/Direct2D+GDI)

OLD APIs

public class Camera
{
    public void GetColorPixelCoordinatesFromDepthPixel(ImageResolution

colorResolution, ImageViewArea
viewArea, int
depthX, int
depthY, short depthValue,
out int
colorX,
out int
colorY);

}
 
publicclass SkeletonEngine
{
    public Vector DepthImageToSkeleton(float depthX, float depthY, short depthValue);
    public void SkeletonToDepthImage(Vector point, out float depthX, out float depthY);
    public void SkeletonToDepthImage(Vector point, out float depthX, out float depthY, out short depthValue);
}

 

NEW APIs

publicsealedclass DepthImageFrame : ImageFrame
{
    public DepthImagePoint MapFromSkeletonPoint(SkeletonPoint

skeletonPoint);

    public ColorImagePoint MapToColorImagePoint(int depthX, int depthY, ColorImageFormat colorImageFormat);
    public SkeletonPoint MapToSkeletonPoint(int depthX, int depthY);
}
publicsealedclass KinectSensor : IDisposable
{
    public void MapDepthFrameToColorFrame(DepthImageFormat depthImageFormat, short[] depthPixelData, ColorImageFormat colorImageFormat, ColorImagePoint[] colorCoordinates);
    public ColorImagePoint MapDepthToColorImagePoint(DepthImageFormat depthImageFormat, int depthX, int depthY, short depthPixelValue, ColorImageFormat colorImageFormat);
    public SkeletonPoint MapDepthToSkeletonPoint(DepthImageFormat depthImageFormat, int depthX, int depthY, short depthPixelValue);
    public ColorImagePoint MapSkeletonPointToColor(SkeletonPoint skeletonPoint, ColorImageFormat colorImageFormat);
    public DepthImagePoint MapSkeletonPointToDepth(SkeletonPoint skeletonPoint, DepthImageFormat depthImageFormat);
}

Audio API improvements

Significant changes:

Relevant samples (installed with SDK):

AUDIO API – SUMMARY OF API CHANGES/REMOVALS/ADDITIONS

<Namespace OldName=Microsoft.Research.Kinect.Audio
Name=Microsoft.Kinect>

    <Type Name=AudioDeviceInfo Removed=True />

    <Type Name=KinectAudioSource>

        <Member Name=FindCaptureDevices Removed=True />

        <Member Name=RetrieveTsStats Removed=True />

        <Member Name=QualityMetrics Removed=True />

        <Member Name=DevicePairGuid Removed=True />

        <Member Name=KinectAudioSource Removed=True />

        <Member OldName=AutomaticGainControl Name=AutomaticGainControlEnabled />

        <Member OldName=SoundSourcePosition Name=SoundSourceAngle Message=Now using degrees, instead of Radians./>

        <Member OldName=SoundSourcePositionConfidence Name=SoundSourceAngleConfidence />

        <Member OldName=MicArrayMode Name=BeamAngleMode />

        <Member OldName=MicArrayBeamAngle Name=ManualBeamAngle />

        <Member OldName=BeamChanged Name=BeamAngleChanged />

        <Member OldName=SpeakerIndex Name=EchoCancellationSpeakerIndex Message=Automatically set to default Speaker on
PC now. />

        <Member Name=AcousticEchoSuppression
Removed=True Message=Replaced by setting kinectAudioSource.EchoCancellationMode
= EchoCancellationMode.CancellationAndSuppression />

        <Member Name=CenterClip Removed=True/>

        <Member Name=EchoLength Removed=True/>

        <Member Name=FeatureMode Removed=True Message=Just remove the line of code that set FeatureMode. It was useless./>

        <Member Name=FrameSize Removed=True/>

        <Member Name=GainBounder Removed=True/>

        <Member Name=MicArrayPreprocess Removed=True/>

        <Member Name=MicrophoneIndex Removed=True/>

        <Member Name=NoiseFill Removed=True/>

        <Member Name=SourceMode Removed=True/>

        <Member Name=VoiceActivityDetector Removed=True/>

        <Member OldName=SystemMode Name=EchoCancellationMode Message=For ArrayOnly,
use EchoCancellationMode.None. For ArrayAndEchoCancellation, use EchoCancellationMode.CancellationOnly. />

        <Member Name=Dispose Removed=True
/>

    </Type>

    <Type Name=MicArrayMode Removed=True />

    <Type Name=SystemMode Removed=True Message=Use EchoCancellationMode
property instead. />

    <Type OldName=BeamChangedEventArgs Name=BeamAngleChangedEventArgs/>

    <Type Name=SoundSourceAngleChangedEventArgs Added=True />

    <Type Name=EchoCancellationMode Added=True />

    <Type Name=BeamAngleMode Added=True />

</Namespace>

 

OLD
CODE

KinectAudioSource audioSource
=
newKinectAudioSource();

audioSource.SystemMode = SystemMode.OptibeamArrayOnly;

audioSource.FeatureMode = true;

audioSource.AutomaticGainControl = false;

audioSource.MicArrayMode = MicArrayMode.MicArrayAdaptiveBeam;

var kinectStream
= audioSource.Start();

NEW
CODE

KinectAudioSource audioSource = kinectSensor.AudioSource;

audioSource.EchoCancellationMode = EchoCancellationMode.CancellationOnly;

audioSource.AutomaticGainControlEnabled = false;

audioSource.BeamAngleMode = BeamAngleMode.Adaptive;

var audioStream
= audioSource.Start();

Speech API improvements

Significant changes:

Relevant samples (installed with SDK):

Kinect for Windows – Code Migration from Beta2 to v1.0 (C#/VB)

[This article covers the C#/VB accessible APIs. It has a peer article that covers the C++ accessible APIs.]

There have been a number of significant changes and improvements in our APIs since Beta2. This set of documents attempts to detail the changes to facilitate code migration from beta 2 to v1.

[Update – 9:44am PST, 2/1 – fixed link to migration dll below. If you still have problems, clearing browser cache may help.]

API Change Details

[these links take you to a seperate post with details]

Adapting to API Changes

In order to adapt to this change, C#/VB developers should:

  • Backup code projects (if not using source control, such as TFS)
  • Uninstall Beta 2 SDK (including speech runtime 10.x components).
  • Install Kinect for Windows SDK v1.
  • Migrate code to use v1 APIs and best practices via one of the migration techniques below
  • If you need help with the answer, go the Kinect for Windows forums. Search for other similar issues first. If needed, create a new issue. Please prefix the title of the forum post with “Migration issue:”. (for example: “Migration Issue: Runtime.Sensors replacement?”)
  • If you figured out the answer, and want to suggest improvements to the details and techniques in these documents, please leave a comment (We generally will respond to that feedback, but won’t show the comments, as it may get unwieldy).

Where to go for help

Code Migration Techniques (C#/VB)

There are three major approaches to migration

1)      RECOMMENDED: Use a migration reference assembly to assist with learning about API changes

2)      RECOMMENDED: Go back to the examples you may have started from, find the newest versions of those, and transfer your improvements to this new version.

3)      NOT RECOMMENDED: Change reference assembly, (recompile -> search for info -> change -> adapt -> repeat)

Using the Migration reference assembly (RECOMMENDED)
  •   Backup code projects (if not using source   control, such as TFS)
  •   Uninstall Beta 2 SDK (including speech runtime   10.x components).
  •   Install Kinect for Windows SDK v1.
  •   Remove Microsoft.Research.Kinect.dll   references
  •   Download (link is fixed now, may need to clear browser cache if still having problems) and add reference to Microsoft.Kinect.Migration.dll
  •   [Ensure all projects, including binary dependencies,   are migrated]
  •   Build and evaluate errors/warnings

After changing all the “usings” of the old namespace to “using   Microsoft.Kinect;”, most of the errors/warnings will point you to renames of   types/members:

  •   Look for guidance in errors/warnings
  •   Look at sample code in SDK to see changes in   event handling code necessary (there have been significant changes with   ImageFrame and SkeletonFrame).
  •   Change code as necessary -> recompile ->   (repeat)
  •   After building successfully with no errors and   warnings (related to name changes)
    •   Remove reference to   Microsoft.Kinect.Migration.dll
    •   Add reference to Microsoft.Kinect.dll
    •   Run application and debug as necessary
Doing it all manually (NOT RECOMMENDED)
[WE STRONGLY RECOMMEND YOU   FOLLOW THE MIGRATION DLL TECHNIQUE ABOVE…AND DON’T FOLLOW THE MANUAL   TECHNIQUE]

  •   Backup code projects (if not using source   control, such as TFS)
  •   Uninstall Beta 2 SDK (including speech runtime   10.x components).
  •   Install Kinect for Windows SDK v1.
  •   Remove Microsoft.Research.Kinect.dll   references
  •   Add reference to Microsoft.Kinect.dll
  •   [Ensure all projects, including binary dependencies,   are migrated]
  •   Build and evaluate errors/warnings
  •   Look at sample code in SDK to see changes in   event handling code necessary (there have been significant changes with   ImageFrame and SkeletonFrame).
  •   Change code as necessary -> recompile ->   (repeat)
  •   Run application and debug as necessary

Kinect for Windows Support Info Coming Soon

[Temporary placeholder page]

Normally, you would have been taken to the Kinect for Windows support site for “more info” about the situation the Kinect sensor UI was in.

The support site with end-user help for issues is coming soon.

Kinect Apps – ensuring Kinect Runtime is installed

Kinect for Windows 1.0 enabled apps should ensure that the Kinect Runtime is installed wherever the app is installed.

[Note: Kinect for Windows 1.0’s latest public preview is beta 2. Parts of this blog post may be applicable to beta 2, but is primarily focused on the final v1.0 version, coming February 1st. Since v1.0 is not yet released, information I give here may change when it does release. I also am filtering this information to ensure that I am not giving away details that we don’t yet want to release.]

Guidelines

App installers should install its dependencies, including Kinect Runtime – CRITICAL

Kinect for Windows 1.0 will have a KinectRuntime-v1.0-Setup.exe that your app installer MUST chain install. In addition to installing Kinect specific software (drivers + runtime), KinectRuntime-v1.0-Setup.exe will ensure the following dependencies are installed:

  • VCRT x86 and/or x64
  • .NET 4 client profile (or later 4.x versions like .NET 4.5)
  • Microsoft Speech Runtime v11 x86 and/or x64

Running an app should provide a decent user experience if Kinect Runtime isn’t installed – RECOMMENDED

    • .NET Applications

If your Kinect App is a .NET 4.x based app (WPF, XNA, WindowsForms, etc…), code like the following sample may help improve your apps user experience in case the Kinect Runtime 1.0 is not installed.

    //App.xaml.cs
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            if (IsKinectRuntimeInstalled)
            {
                //go ahead and load the StartupUri as defined in App.xaml
                base.OnStartup(e);
            }
            else
            {
                MessageBox.Show(Assembly.GetExecutingAssembly().FullName + " is not able to excecute."
                + "An important dependency should have been installed by its setup program: Microsoft Kinect Runtime 1.0");
            }
        }

        public bool IsKinectRuntimeInstalled {
            get
            {
                bool isInstalled;
                try
                {
                    TestForKinectTypeLoadException();
                    isInstalled = true;
                }
                catch (FileNotFoundException)
                {
                    isInstalled = false;
                }
                return isInstalled;
            }
        }

        // This Microsoft.Kinect.dll based type, must be isolated in its own method
        // as the CLR will attempt to load the Microsoft.Kinect.dll assembly it when this method is executed.
        private void TestForKinectTypeLoadException()
        {
#pragma warning disable 219 //ignore the fact that status is unused code after this set.
            var status = KinectStatus.Disconnected;
#pragma warning restore 219
        }
    }
  • Native Applications

If your Kinect App is a Native Windows based app (C++ using GDI/GDI+/D2D/DirectX/etc..), your application should handle a missing Kinect10.dll in a way that informs the user of the problem and how to fix it.