Share via


Audio Basics-WPF-VB Sample

Kinect for Windows 1.5, 1.6, 1.7, 1.8

Overview

The Kinect for Windows sensor has a four-microphone array which can be used for audio capture, sound source direction detection, and beamforming to listen for a desired sound source in a noisy environment.

When you run this sample, you see the following:

  • A real-time visualization of the audio signal strength in the scrolling waveform at the top of the display.
  • A semicircular bar that contains a pointer (audio beam angle) and a shaded arc (audio source angle and confidence level).
    • Pointer (audio beam angle) - An arrow pointed in the direction of the most recent sound. The arrow takes a moment to update when the sound location moves. This is because in a noisy environment, constantly changing the angle to match the most recent sound can be counterproductive and computationally expensive.
    • Shaded arc (audio source angle and confidence level)
      • Audio source angle - The direction of the most recent sound. Shown by shading the arc.
      • Confidence level - The confidence that the source angle is correct. Shown as the width of the rendered arc: narrow means high confidence and wide means low confidence. Confidence can be very low in noisy environments where the sound is not much louder than the background noise.
The Sample Uses the Following APIs To Do This
KinectSensor.KinectSensors Property Get the Kinect sensors that are plugged in and ready for use.
KinectStatus.Connected enumeration value Confirm that the sensor is fully connected and ready to send data.
KinectSensor.Status Property Get the current status of the given Kinect sensor.
KinectSensor.Start Method and KinectSensor.Stop Method Start or stop a sensor.
KinectAudioSource.Start Method and KinectAudioSource.Stop Method Start and stop the audio stream.
KinectAudioSource.BeamAngleChanged Event Add an event handler for the beam angle changed event. This event is fired when the sensor changes the direction in which it is listening most intently.
KinectAudioSource.SoundSourceAngleChanged Event Add an event handler for the sound source angle changed event. This event is fired when the sensor detects a new sound source. In noisy environments, this event can fire frequently.

For a detailed discussion of how to read and use an audio stream, see Capturing Audio Data in C#.

To run a sample you must have the Kinect for Windows SDK installed. To compile a sample, you must have the developer toolkit installed. The latest SDK and developer toolkit are available on the developer download page. If you need help installing the toolkit, look on this page: To Install the SDK and Toolkit. The toolkit includes a sample browser, which you can use to launch a sample or download it to your machine. To open the sample browser, click Start > All Programs > Kinect for Windows SDK [version number] > Developer Toolkit Browser.

If you need help loading a sample in Visual Studio or using Visual Studio to compile, run, or debug, see Opening, Building, and Running Samples in Visual Studio.