How do I process audio with KinectKit?
Last reviewed: 10/4/2012
HOW Article ID: H101207
The information in this article applies to:
- KinectKit
Summary
The Kinect sensor includes a four-element linear microphone array that provides local signal processing including acoustic echo cancellation and noise suppression.
This enables applications to capture high-quality audio, detect the source direction, and use with speech recognition.
More Information
The KinectKit movement management component is designed to provide you a lot of flexiblity and minimize the programming necessary to manage audio data from a Microsoft Kinect sensor.
To start capturing audio and optionally persist to a file, simply use the StartRecording method to start the audio stream. For example:
string path = Directory.GetCurrentDirectory();
// Append path terminator
path += "\\";
// Start audio source and persist to a file. Have KinectKit generate a unique file name.
NChantKM1.StartRecording(0, path, ChantRecordingResult.CRRFile, ChantAudioFormat.CAFDefault, ChantKinectStream.CKSAudio, "");
wchar_t path[MAX_PATH];
GetCurrentDirectory(MAX_PATH, path);
int length = wcslen(path);
// Append path terminator
path[length] = L'\\';
path[length + 1] = L'\0';
// Start audio source and persist to a file. Have KinectKit generate a unique file name.
m_pChantKM->StartRecording(0, path, CRRFile, CAFDefault, CKSAudio);
wchar_t path[MAX_PATH];
GetCurrentDirectoryW(MAX_PATH, path);
int length = wcslen(path);
// Append path terminator
path[length] = L'\\';
path[length + 1] = L'\0';
// Start audio source and persist to a file. Have KinectKit generate a unique file name.
m_pChantKM->StartRecording(0, String(path), CRRFile, CAFDefault, CKSAudio);
var
path: array [0..MAX_PATH] of WideChar;
pathLength: Integer;
begin
GetCurrentDirectoryW(MAX_PATH, path);
pathLength := Length(path);
// Append path terminator
path[pathLength] := WideChar('\');
path[pathLength + 1] := WideChar('0');
// Start audio source and persist to a file. Have KinectKit generate a unique file name.
ChantKM1.StartRecording(0, string(path), CRRFile, CAFDefault, CKSAudio);
end;
String path = new File(".").getAbsolutePath();
// Append path terminator
path += "\\";
// Start audio source and persist to a file. Have KinectKit generate a unique file name.
JChantKM1.startRecording(0, path, ChantRecordingResult.CRRFile, ChantAudioFormat.CAFDefault, ChantKinectStream.CKSAudio, "");
Dim path as String
path = Directory.GetCurrentDirectory()
' Append path terminator
path += "\\"
' Start audio source and persist to a file. Have KinectKit generate a unique file name.
NChantKM1.StartRecording(0, path, ChantRecordingResult.CRRFile, ChantAudioFormat.CAFDefault, ChantKinectStream.CKSAudio, "")
To stop capturing audio data, simply use the StopRecording method to stop the audio stream. For example:
nChantKM.StopRecording(0);
pChantKM->StopRecording(0);
pChantKM->StopRecording(0);
aTChantKM.StopRecording(0);
jChantKM.stopRecording(0);
nChantKM.StopRecording(0)
For additional help with KinectKit, contact Chant Support via or web.