Kinect帮助资料

  • 格式:pdf
  • 大小:433.91 KB
  • 文档页数:12
AudioCaptureRaw Walkthrough: C++
Capturing the Raw Audio Stream
Beta 1 Draft Version 1.0 – June 16, 2011
About this Walkthrough In the Kinect™ for Windows® Software Development Kit (SDK) Beta from Microsoft® Research, the AudioCaptureRaw sample uses the Windows Audio Session API (WASAPI) to capture the raw audio stream from the microphone array of the Kinect for Xbox 360® sensor and write it to a .wav file. This document is a walkthrough of the sample. Resources For a complete list of documentation for the Kinect for Windows SDK Beta, plus related reference and links to the online forums, see the SDK Beta website at: /kinectsdk Contents
Introduction ....................................................................................................................................................................................................... 2 Program Description ...................................................................................................................................................................................... 2 Select a Capture Device ................................................................................................................................................................................ 3 Enumerate the Capture Devices ............................................................................................................................................................ 4 Retrieve the Device Name ....................................................................................................................................................................... 5 Determine the Device Index ........................................................................................................................................ 6 Prepare for Audio Capture .......................................................................................................................................................................... 6 Initialization ................................................................................................................................................................................................... 7 Load the Format .......................................................................................................................................................................................... 7 Initialize the Audio Engine ....................................................................................................................................................................... 7 Capture an Audio Stream from the Microphone Array ................................................................................................................... 8 The Primary Thread .................................................................................................................................................................................... 8 The Worker Thread .................................................................................................................................................................................. 10
AudioCaptureRaw Walkthrough: C++ – 2
Introduction
The audio component of the Kinect™ for Xbox 360 ® sensor is a four-element linear microphone array. An array provides some significant advantages over a single microphone, including more sophisticated echo cancellation and noise suppression, and the ability to determine the direction of a sound source. The primary way for C++ applications to access the Kinect sensor’s microphone array is th rough the KinectAudio Microsoft® DirectX® Media Object (DMO). However, it is useful for some purposes to simply capture the raw audio streams from the array’s microphones. The Kinect sensor’s microphone array is a standard Windows ® multichannel audio-capture device, so you can also capture the audio stream by using the Windows Audio Session API (WASAPI), or use the microphone array as a standard Windows microphone. The AudioCaptureRaw sample uses the WASAPI to capture the raw audio stream from the Kinect sensor’s microphone array and write it to a .wav file. This document is a walkthrough of the sample. For more information on WASAPI, see “ About WASAPI” on the Microsoft Developer Network (MSDN®) website. Note WASAPI is COM-based, and this document assumes that you are familiar with the basics of how to use COM objects and interfaces. You do not need to know how to implement COM objects. For the basics of how to use COM objects, see “Programming DirectX with COM” on the MSDN website. That MSDN topic is written for DirectX programmers, but the basic principles apply to all COM-based applications.