The following code uses the XStudio API to record NUI streams to a .XEF file and then play back the file.
#include "XStudio.h"
using namespace Microsoft::Xbox::Tools::XStudio;
IXStudioSession* m_pXStudioSession;
XStudioCreateSession(&m_pXStudioSession);
IXStudioRecording* m_pRecorder;
IXStudioPlayback* m_pPlayer;
// Create a recorder instance
if ( FAILED( m_pXStudioSession->CreateRecording(
XSTUDIO_LOCATION_DEVKIT, // The .XEF file resides on the console.
m_RecordingPath, // A fully-qualified .XEF file name.
XSTUDIO_DEFAULT_NUI_RECORDING_STREAMS, // This includes the depth, active IR, and body streams.
ARRAYSIZE( XSTUDIO_DEFAULT_NUI_RECORDING_STREAMS ),
&m_pRecorder ) ) // A recorder instance.
)
{
m_pRecorder->Stop();
m_pRecorder->Release();
m_pRecorder = NULL;
// Add other error handling logic.
}
m_pRecorder->Start();
// Create a player instance
if (FAILED( m_pXStudioSession->CreatePlayback(
XSTUDIO_LOCATION_DEVKIT, // The .XEF file resides on the console.
m_RecordingPath, // A fully-qualified .XEF file name.
XSTUDIO_DEFAULT_NUI_PLAYBACK_STREAMS, // This includes the depth and active IR streams.
ARRAYSIZE( XSTUDIO_DEFAULT_NUI_PLAYBACK_STREAMS ),
&m_pPlayer ) ) // A player instance.
)
{
m_pPlayer->Stop();
m_pPlayer->Release();
m_pPlayer = NULL;
// Add other error handling logic.
}
m_pPlayer->Start();
For the complete code listing, see the SimpleXStudioRecordPlayback sample.