xn::AudioGenerator Class Reference
C++ Reference to Application Programmer Interface (API) » Production Nodes Functionality

`#include <XnCppWrapper.h>`

Inheritance diagram for xn::AudioGenerator:
[legend]

## Public Member Functions

| AudioGenerator (XnNodeHandle hNode=NULL)
| AudioGenerator (const NodeWrapper &other)
XnStatus | Create (Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
void | GetMetaData (AudioMetaData &metaData) const
const XnUChar * | GetAudioBuffer () const
XnUInt32 | GetSupportedWaveOutputModesCount () const
XnStatus | GetSupportedWaveOutputModes (XnWaveOutputMode *aSupportedModes, XnUInt32 &nCount) const
XnStatus | SetWaveOutputMode (const XnWaveOutputMode &OutputMode)
XnStatus | GetWaveOutputMode (XnWaveOutputMode &OutputMode) const
XnStatus | RegisterToWaveOutputModeChanges (StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
void | UnregisterFromWaveOutputModeChanges (XnCallbackHandle hCallback)
Public Member Functions inherited from xn::Generator
| Generator (XnNodeHandle hNode=NULL)
| Generator (const NodeWrapper &other)
XnStatus | StartGenerating ()
XnBool | IsGenerating () const
XnStatus | StopGenerating ()
XnStatus | RegisterToGenerationRunningChange (StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
void | UnregisterFromGenerationRunningChange (XnCallbackHandle hCallback)
XnStatus | RegisterToNewDataAvailable (StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
void | UnregisterFromNewDataAvailable (XnCallbackHandle hCallback)
XnBool | IsNewDataAvailable (XnUInt64 *pnTimestamp=NULL) const
XnStatus | WaitAndUpdateData ()
XnBool | IsDataNew () const
const void * | GetData ()
XnUInt32 | GetDataSize () const
XnUInt64 | GetTimestamp () const
XnUInt32 | GetFrameID () const
const MirrorCapability | GetMirrorCap () const
MirrorCapability | GetMirrorCap ()
const AlternativeViewPointCapability | GetAlternativeViewPointCap () const
AlternativeViewPointCapability | GetAlternativeViewPointCap ()
const FrameSyncCapability | GetFrameSyncCap () const
FrameSyncCapability | GetFrameSyncCap ()
Public Member Functions inherited from xn::ProductionNode
| ProductionNode (XnNodeHandle hNode=NULL)
| ProductionNode (const NodeWrapper &other)
NodeInfo | GetInfo () const
XnStatus | AddNeededNode (ProductionNode &needed)
XnStatus | RemoveNeededNode (ProductionNode &needed)
void | GetContext (Context &context) const
Context | GetContext () const
XnBool | IsCapabilitySupported (const XnChar *strCapabilityName) const
XnStatus | SetIntProperty (const XnChar *strName, XnUInt64 nValue)
XnStatus | SetRealProperty (const XnChar *strName, XnDouble dValue)
XnStatus | SetStringProperty (const XnChar *strName, const XnChar *strValue)
XnStatus | SetGeneralProperty (const XnChar *strName, XnUInt32 nBufferSize, const void *pBuffer)
XnStatus | GetIntProperty (const XnChar *strName, XnUInt64 &nValue) const
XnStatus | GetRealProperty (const XnChar *strName, XnDouble &dValue) const
XnStatus | GetStringProperty (const XnChar *strName, XnChar *csValue, XnUInt32 nBufSize) const
XnStatus | GetGeneralProperty (const XnChar *strName, XnUInt32 nBufferSize, void *pBuffer) const
XnStatus | LockForChanges (XnLockHandle *phLock)
void | UnlockForChanges (XnLockHandle hLock)
XnStatus | LockedNodeStartChanges (XnLockHandle hLock)
void | LockedNodeEndChanges (XnLockHandle hLock)
const ErrorStateCapability | GetErrorStateCap () const
ErrorStateCapability | GetErrorStateCap ()
GeneralIntCapability | GetGeneralIntCap (const XnChar *strCapability)
Public Member Functions inherited from xn::NodeWrapper
| NodeWrapper (XnNodeHandle hNode)
| NodeWrapper (const NodeWrapper &other)
NodeWrapper & | operator= (const NodeWrapper &other)
| ~NodeWrapper ()
| operator XnNodeHandle () const
XnNodeHandle | GetHandle () const
XnBool | operator== (const NodeWrapper &other)
XnBool | operator!= (const NodeWrapper &other)
XnBool | IsValid () const
const XnChar * | GetName () const
XnStatus | AddRef ()
void | Release ()
void | SetHandle (XnNodeHandle hNode)
void | TakeOwnership (XnNodeHandle hNode)

## Detailed Description

Purpose: An audio generator node generates audio data.

Event: 'Wave Output Mode Change'

Signals that the node's current configuration's Wave Output Mode has been changed to some other wave output mode.

Use RegisterToWaveOutputModeChanges() and UnregisterFromWaveOutputModeChanges() for using this event.

This event is raised by calling SetWaveOutputMode().

## Constructor & Destructor Documentation

## AudioGenerator() [1/2]

xn::AudioGenerator::AudioGenerator | ( | XnNodeHandle | hNode = NULL | ) |

inline

Ctor

Parameters

  [in] | hNode | Node handle

## AudioGenerator() [2/2]

xn::AudioGenerator::AudioGenerator | ( | const NodeWrapper & | other | ) |

inline

## Member Function Documentation

## Create()

XnStatus xn::AudioGenerator::Create | ( | Context & | context,
|  | Query * | pQuery = NULL,
|  | EnumerationErrors * | pErrors = NULL )

inline

Creates an AudioGenerator node from available production node alternatives.

Remarks

See create_method for a detailed description of this method.

## GetAudioBuffer()

const XnUChar * xn::AudioGenerator::GetAudioBuffer | ( |  | ) | const

inline

For full details and usage, see xnGetAudioBuffer

## GetMetaData()

void xn::AudioGenerator::GetMetaData | ( | AudioMetaData & | metaData | ) | const

inline

Gets the audio generator node's latest frame object, saving it in the xn::AudioMetaData object. This frame object is a snapshot of the generated label map data and its associated configuration information at a certain point in time. This saved frame object provides fast and easy access to the audio generator node's data and configuration information.

Parameters

  [out] | metaData | Structure to be filled with the frame object.

Remarks:

This method is central in the use of the AudioGenerator node. Once the AudioGenerator node is generating data, after each 'Update Data' call, the application calls this method to get the node's frame object, which contains the data and all its associated properties.

## GetSupportedWaveOutputModes()

XnStatus xn::AudioGenerator::GetSupportedWaveOutputModes | ( | XnWaveOutputMode * | aSupportedModes,
|  | XnUInt32 & | nCount ) const

inline

Returns a list of the wave output modes that the AudioGenerator node supports.

Parameters

  [out] | aSupportedModes | Buffer to be filled with the list of wave output modes.
  [in,out] | nCount | [in] Size of the array. [out] Number of modes returned.

## GetSupportedWaveOutputModesCount()

XnUInt32 xn::AudioGenerator::GetSupportedWaveOutputModesCount | ( |  | ) | const

inline

Gets the node's number of supported wave output modes.

## GetWaveOutputMode()

XnStatus xn::AudioGenerator::GetWaveOutputMode | ( | XnWaveOutputMode & | OutputMode | ) | const

inline

Gets the current AudioGenerator node's wave output mode. This output mode is used for generating the next audio packet.

Parameters

  [out] | OutputMode | Current wave output mode.

Remarks

The wave output mode is contained in the XnWaveOutputMode struct. Each wave output mode comprises settings for bits per sample, channel, and sample rate, as follows:

## RegisterToWaveOutputModeChanges()

XnStatus xn::AudioGenerator::RegisterToWaveOutputModeChanges | ( | StateChangedHandler | handler,
|  | void * | pCookie,
|  | XnCallbackHandle & | hCallback )

inline

Registers an event handler for the 'Wave Output Mode Change' event.

Parameters

  [in] | handler | Callback function to be invoked when the event is raised.
  [in] | pCookie | User's cookie, to be delivered to the callback.
  [out] | hCallback | Handle to the callback to be used for unregistering it.

For full details and usage of the parameters, see Registering to Events.

## SetWaveOutputMode()

XnStatus xn::AudioGenerator::SetWaveOutputMode | ( | const XnWaveOutputMode & | OutputMode | ) |

inline

Sets the current wave output mode of the AudioGenerator node. This output mode is used for generating the next audio packet.

Parameters

  [in] | OutputMode | Mode to set as the current wave output mode.

Remarks

The wave output mode is contained in the xn::XnWaveOutputMode struct. It comprises: bits per sample, channel, and sample rate.

## UnregisterFromWaveOutputModeChanges()

void xn::AudioGenerator::UnregisterFromWaveOutputModeChanges | ( | XnCallbackHandle | hCallback | ) |

inline

Unregisters an event handler for the 'Wave Output Mode Change' event.

Parameters

  [in] | hCallback | Handle received from registration.

For full details and usage of the parameter, see Unregistering from Events .

The documentation for this class was generated from the following file:

- XnCppWrapper.h