SharpDX.XAudio2 The assembly provides managed and APIs. hh405049 XAudio2 XAudio2 Contains information about anXAPOfor use in an effect chain.

XAPO instances are passed to XAudio2 as interfaces and XAudio2 uses IXAPO::QueryInterface to acquire an interface and to detect whether the XAPO implements the interface.

For additional information on using XAPOs with XAudio2 see How to: Create an Effect Chain and How to: Use an XAPO in XAudio2.

microsoft.directx_sdk.xaudio2.xaudio2_effect_descriptor XAUDIO2_EFFECT_DESCRIPTOR XAUDIO2_EFFECT_DESCRIPTOR
Initializes a new instance of the class with a Stereo Effect. The effect. Initializes a new instance of the class. The effect. The output channel count. No documentation. IUnknown* pEffect IUnknown pEffect No documentation. BOOL InitialState BOOL InitialState No documentation. unsigned int OutputChannels unsigned int OutputChannels Gets or sets the AudioProcessor. The AudioProcessor cannot be set more than one. The effect. Represents an audio data buffer, used withIXAudio2SourceVoice::SubmitSourceBuffer.

XAudio2 audio data is interleaved, data from each channel is adjacent for a particular sample number. For example if there was a 4 channel wave playing into an XAudio2 source voice, the audio data would be a sample of channel 0, a sample of channel 1, a sample of channel 2, a sample of channel 3, and then the next sample of channels 0, 1, 2, 3, etc.

The AudioBytes and pAudioData members of correspond to the size in bytes and contents of the 'data' RIFF chunk of the file being played. The contents of the chunk may need to be byte swapped when loading the file on Xbox 360.

Memory allocated to hold a or structure can be freed as soon as the call it is passed to returns. The data the structure points to (pAudioData and pDecodedPacketCumulativeBytes, respectively) can't be freed until the buffer completes (as signaled by the callback) or the voice is stopped or destroyed.

microsoft.directx_sdk.xaudio2.xaudio2_buffer XAUDIO2_BUFFER XAUDIO2_BUFFER
Constant LoopInfinite. XAUDIO2_LOOP_INFINITE Initializes a new instance of the class. Initializes a new instance of the class. The stream to get the audio buffer from. Initializes a new instance of the class. The buffer to get the audio buffer from. No documentation. XAUDIO2_BUFFER_FLAGS Flags XAUDIO2_BUFFER_FLAGS Flags No documentation. unsigned int AudioBytes unsigned int AudioBytes No documentation. const unsigned char* pAudioData unsigned char pAudioData No documentation. unsigned int PlayBegin unsigned int PlayBegin No documentation. unsigned int PlayLength unsigned int PlayLength No documentation. unsigned int LoopBegin unsigned int LoopBegin No documentation. unsigned int LoopLength unsigned int LoopLength No documentation. unsigned int LoopCount unsigned int LoopCount No documentation. void* pContext void pContext Gets or sets the datastream associated to this audio buffer The stream. The IXAudio2EngineCallback interface contains methods that notify the client when certain events happen in the engine. This interface should be implemented by the XAudio2 client. XAudio2 calls these methods via an interface pointer provided by the client, using either the {{XAudio2Create}} or method. Methods in this interface return void, rather than an HRESULT. IXAudio2EngineCallback Theinterface contains methods that notify the client when certain events happen in theIXAudio2engine. This interface should be implemented by the XAudio2 client. XAudio2 calls these methods via an interface reference provided by the client, using theXAudio2Createmethod. Methods in this interface returnvoid, rather than an .

See XAudio2 Callbacks for restrictions on callback implementation.

ee415910 IXAudio2EngineCallback IXAudio2EngineCallback
Called by XAudio2 just before an audio processing pass begins. void IXAudio2EngineCallback::OnProcessingPassStart() Called by XAudio2 just after an audio processing pass ends. void IXAudio2EngineCallback::OnProcessingPassEnd() Called if a critical system error occurs that requires XAudio2 to be closed down and restarted. Error code returned by XAudio2. void IXAudio2EngineCallback::OnCriticalError([None] HRESULT Error) Internal EngineCallback Callback Impl Return a pointer to the unamanged version of this callback. The callback. A pointer to a shadow c++ callback Called by XAudio2 just after an audio processing pass ends. void IXAudio2EngineCallback::OnProcessingPassEnd() Called if a critical system error occurs that requires XAudio2 to be closed down and restarted. This pointer Error code returned by XAudio2. void IXAudio2EngineCallback::OnCriticalError([None] HRESULT Error) EventArgs used by . Initializes a new instance of the class. The error code. Gets or sets the error code. The error code. XAudio2FxContants Functions. Constant None. Constant None. Constant None. Constant None. No documentation. XAUDIO2_BUFFER_FLAGS XAUDIO2_BUFFER_FLAGS No documentation. XAUDIO2_END_OF_STREAM XAUDIO2_END_OF_STREAM None. None None Indicates whether a filter is low pass, band pass, high pass, or notch. ee419238 XAUDIO2_FILTER_TYPE XAUDIO2_FILTER_TYPE No documentation. LowPassFilter LowPassFilter No documentation. BandPassFilter BandPassFilter No documentation. HighPassFilter HighPassFilter No documentation. NotchFilter NotchFilter No documentation. LowPassOnePoleFilter LowPassOnePoleFilter No documentation. HighPassOnePoleFilter HighPassOnePoleFilter No documentation. XAUDIO2_LOG_TYPE XAUDIO2_LOG_TYPE No documentation. XAUDIO2_LOG_ERRORS XAUDIO2_LOG_ERRORS No documentation. XAUDIO2_LOG_WARNINGS XAUDIO2_LOG_WARNINGS No documentation. XAUDIO2_LOG_INFO XAUDIO2_LOG_INFO No documentation. XAUDIO2_LOG_DETAIL XAUDIO2_LOG_DETAIL No documentation. XAUDIO2_LOG_API_CALLS XAUDIO2_LOG_API_CALLS No documentation. XAUDIO2_LOG_FUNC_CALLS XAUDIO2_LOG_FUNC_CALLS No documentation. XAUDIO2_LOG_TIMING XAUDIO2_LOG_TIMING No documentation. XAUDIO2_LOG_LOCKS XAUDIO2_LOG_LOCKS No documentation. XAUDIO2_LOG_MEMORY XAUDIO2_LOG_MEMORY No documentation. XAUDIO2_LOG_STREAMING XAUDIO2_LOG_STREAMING No documentation. XAUDIO2_PLAY_FLAGS XAUDIO2_PLAY_FLAGS No documentation. XAUDIO2_PLAY_TAILS XAUDIO2_PLAY_TAILS None. None None Windows-specific enumerator for available processors. microsoft.directx_sdk.xaudio2.xaudio2_windows_processor_specifier XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER No documentation. Processor1 Processor1 No documentation. Processor2 Processor2 No documentation. Processor3 Processor3 No documentation. Processor4 Processor4 No documentation. Processor5 Processor5 No documentation. Processor6 Processor6 No documentation. Processor7 Processor7 No documentation. Processor8 Processor8 No documentation. Processor9 Processor9 No documentation. Processor10 Processor10 No documentation. Processor11 Processor11 No documentation. Processor12 Processor12 No documentation. Processor13 Processor13 No documentation. Processor14 Processor14 No documentation. Processor15 Processor15 No documentation. Processor16 Processor16 No documentation. Processor17 Processor17 No documentation. Processor18 Processor18 No documentation. Processor19 Processor19 No documentation. Processor20 Processor20 No documentation. Processor21 Processor21 No documentation. Processor22 Processor22 No documentation. Processor23 Processor23 No documentation. Processor24 Processor24 No documentation. Processor25 Processor25 No documentation. Processor26 Processor26 No documentation. Processor27 Processor27 No documentation. Processor28 Processor28 No documentation. Processor29 Processor29 No documentation. Processor30 Processor30 No documentation. Processor31 Processor31 No documentation. Processor32 Processor32 No documentation. XAUDIO2_ANY_PROCESSOR XAUDIO2_ANY_PROCESSOR No documentation. XAUDIO2_DEFAULT_PROCESSOR XAUDIO2_DEFAULT_PROCESSOR No documentation. XAUDIO2_VOICE_FLAGS XAUDIO2_VOICE_FLAGS No documentation. XAUDIO2_VOICE_NOPITCH XAUDIO2_VOICE_NOPITCH No documentation. XAUDIO2_VOICE_NOSRC XAUDIO2_VOICE_NOSRC No documentation. XAUDIO2_VOICE_NOSAMPLESPLAYED XAUDIO2_VOICE_NOSAMPLESPLAYED None. None None No documentation. XAUDIO2_VOICE_SEND_FLAGS XAUDIO2_VOICE_SEND_FLAGS No documentation. XAUDIO2_VOICE_USEFILTER XAUDIO2_VOICE_USEFILTER None. None None No documentation. XAUDIO2_FLAGS XAUDIO2_FLAGS None. None None Functions No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT XAudio2Create([Out, Fast] IXAudio2** ppXAudio2,[In] unsigned int Flags,[In] unsigned int XAudio2Processor) XAudio2Create No documentation. No documentation. No documentation. HRESULT CreateAudioReverb([Out, Fast] IUnknown** ppApo) CreateAudioReverb No documentation. No documentation. No documentation. HRESULT CreateAudioVolumeMeter([Out, Fast] IUnknown** ppApo) CreateAudioVolumeMeter Describes I3DL2 (Interactive 3D Audio Rendering Guidelines Level 2.0) parameters for use in theReverbConvertI3DL2ToNativefunction.

There are many preset values defined for the structure. For more information, see XAUDIO2FX_I3DL2_PRESET.

ee419220 XAUDIO2FX_REVERB_I3DL2_PARAMETERS XAUDIO2FX_REVERB_I3DL2_PARAMETERS
No documentation. float WetDryMix float WetDryMix No documentation. int Room int Room No documentation. int RoomHF int RoomHF No documentation. float RoomRolloffFactor float RoomRolloffFactor No documentation. float DecayTime float DecayTime No documentation. float DecayHFRatio float DecayHFRatio No documentation. int Reflections int Reflections No documentation. float ReflectionsDelay float ReflectionsDelay No documentation. int Reverb int Reverb No documentation. float ReverbDelay float ReverbDelay No documentation. float Diffusion float Diffusion No documentation. float Density float Density No documentation. float HFReference float HFReference Describes parameters for use in the reverb APO.

All parameters related to sampling rate or time are relative to a 48kHz voice and must be scaled for use with other sampling rates. For example, setting ReflectionsDelay to 300ms gives a true 300ms delay when the reverb is hosted in a 48kHz voice, but becomes a 150ms delay when hosted in a 24kHz voice.

ee419224 XAUDIO2FX_REVERB_PARAMETERS XAUDIO2FX_REVERB_PARAMETERS
Percentage of the output that will be reverb. Allowable values are from 0 to 100.
ee419224 float WetDryMix float WetDryMix
The delay time of the first reflection relative to the direct path. Permitted range is from 0 to 300 milliseconds.
Note
All parameters related to sampling rate or time are relative to a 48kHz sampling rate and must be scaled for use with other sampling rates. See remarks section below for additional information.
ee419224 unsigned int ReflectionsDelay unsigned int ReflectionsDelay
Delay of reverb relative to the first reflection. Permitted range is from 0 to 85 milliseconds.
Note
All parameters related to sampling rate or time are relative to a 48kHz sampling rate and must be scaled for use with other sampling rates. See remarks section below for additional information.
ee419224 unsigned char ReverbDelay unsigned char ReverbDelay
Delay for the left rear output and right rear output. Permitted range is from 0 to 5 milliseconds.
Note
All parameters related to sampling rate or time are relative to a 48kHz sampling rate and must be scaled for use with other sampling rates. See remarks section below for additional information.
ee419224 unsigned char RearDelay unsigned char RearDelay
Position of the left input within the simulated space relative to the listener. With PositionLeft set to the minimum value, the left input is placed close to the listener. In this position, early reflections are dominant, and the reverb decay is set back in the sound field and reduced in amplitude. With PositionLeft set to the maximum value, the left input is placed at a maximum distance from the listener within the simulated room. PositionLeft does not affect the reverb decay time (liveness of the room), only the apparent position of the source relative to the listener. Permitted range is from 0 to 30 (no units).
ee419224 unsigned char PositionLeft unsigned char PositionLeft
Same as PositionLeft, but affecting only the right input. Permitted range is from 0 to 30 (no units).
Note
PositionRight is ignored in mono-in/mono-out mode.
ee419224 unsigned char PositionRight unsigned char PositionRight
Gives a greater or lesser impression of distance from the source to the listener. Permitted range is from 0 to 30 (no units).
ee419224 unsigned char PositionMatrixLeft unsigned char PositionMatrixLeft
Gives a greater or lesser impression of distance from the source to the listener. Permitted range is from 0 to 30 (no units).
Note
PositionMatrixRight is ignored in mono-in/mono-out mode.
ee419224 unsigned char PositionMatrixRight unsigned char PositionMatrixRight
Controls the character of the individual wall reflections. Set to minimum value to simulate a hard flat surface and to maximum value to simulate a diffuse surface. Permitted range is from 0 to 15 (no units).
ee419224 unsigned char EarlyDiffusion unsigned char EarlyDiffusion
Controls the character of the individual wall reverberations. Set to minimum value to simulate a hard flat surface and to maximum value to simulate a diffuse surface. Permitted range is from 0 to 15 (no units).
ee419224 unsigned char LateDiffusion unsigned char LateDiffusion
Adjusts the decay time of low frequencies relative to the decay time at 1 kHz. The values correspond to dB of gain as follows:
Value0123456789101112
Gain (dB)-8-7-6-5-4-3-2-10+1+2+3+4

Note that a LowEQGain value of 8 results in the decay time of low frequencies being equal to the decay time at 1 kHz. Permitted range is from 0 to 12 (no units).

ee419224 unsigned char LowEQGain unsigned char LowEQGain
Sets the corner frequency of the low pass filter that is controlled by the LowEQGain parameter. The values correspond to frequency in Hz as follows:
Value0123456789
Frequency (Hz)50100150200250300350400450500

Permitted range is from 0 to 9 (no units).

ee419224 unsigned char LowEQCutoff unsigned char LowEQCutoff
Adjusts the decay time of high frequencies relative to the decay time at 1 kHz. When set to zero, high frequencies decay at the same rate as 1 kHz. When set to maximum value, high frequencies decay at a much faster rate than 1 kHz.
Value012345678
Gain (dB)-8-7-6-5-4-3-2-10

Permitted range is from 0 to 8 (no units).

ee419224 unsigned char HighEQGain unsigned char HighEQGain
Sets the corner frequency of the high pass filter that is controlled by the HighEQGain parameter. The values correspond to frequency in kHz as follows:
Value01234567891011121314
Frequency (kHz)11.522.533.544.555.566.577.58

Permitted range is from 0 to 14 (no units).

ee419224 unsigned char HighEQCutoff unsigned char HighEQCutoff
Sets the corner frequency of the low pass filter for the room effect. Permitted range is from 20 to 20,000 Hz.
Note
All parameters related to sampling rate or time are relative to a 48kHz sampling rate and must be scaled for use with other sampling rates. See remarks section below for additional information.
ee419224 float RoomFilterFreq float RoomFilterFreq
Sets the pass band intensity level of the low-pass filter for both the early reflections and the late field reverberation. Permitted range is from -100 to 0 dB.
ee419224 float RoomFilterMain float RoomFilterMain
Sets the intensity of the low-pass filter for both the early reflections and the late field reverberation at the corner frequency (RoomFilterFreq). Permitted range is from -100 to 0 dB.
ee419224 float RoomFilterHF float RoomFilterHF
Adjusts the intensity of the early reflections. Permitted range is from -100 to 20 dB.
ee419224 float ReflectionsGain float ReflectionsGain
Adjusts the intensity of the reverberations. Permitted range is from -100 to 20 dB.
ee419224 float ReverbGain float ReverbGain
Reverberation decay time at 1 kHz. This is the time that a full scale input signal decays by 60 dB. Permitted range is from 0.1 to infinity seconds.
ee419224 float DecayTime float DecayTime
Controls the modal density in the late field reverberation. For colorless spaces, Density should be set to the maximum value (100). As Density is decreased, the sound becomes hollow (comb filtered). This is an effect that can be useful if you are trying to model a silo. Permitted range as a percentage is from 0 to 100.
ee419224 float Density float Density
The apparent size of the acoustic space. Permitted range is from 1 to 100 feet.
ee419224 float RoomSize float RoomSize
If set to TRUE, disables late field reflection calculations. Disabling late field reflection calculations results in a significant CPU time savings.
ee419224 BOOL DisableLateField BOOL DisableLateField
Describes parameters for use with the volume meter APO.

This structure is used with the XAudio2 method.

pPeakLevels and pRMSLevels are not returned by , the arrays are only filled out if they are present. If pPeakLevels and pRMSLevels are used they must be allocated by the application. The application is responsible for freeing the arrays when they are no longer needed.

ChannelCount must be set by the application to match the number of channels in the voice the effect is applied to.

ee419225 XAUDIO2FX_VOLUMEMETER_LEVELS XAUDIO2FX_VOLUMEMETER_LEVELS
Array that will be filled with the maximum absolute level for each channel during a processing pass. The array must be at least ChannelCount ? sizeof(float) bytes. pPeakLevels may be null if pRMSLevels is not null.
ee419225 float* pPeakLevels float pPeakLevels
Array that will be filled with root mean square level for each channel during a processing pass. The array must be at least ChannelCount ? sizeof(float) bytes. pRMSLevels may be null if pPeakLevels is not null.
ee419225 float* pRMSLevels float pRMSLevels
Number of channels being processed.
ee419225 unsigned int ChannelCount unsigned int ChannelCount
A mastering voice is used to represent the audio output device. Data buffers cannot be submitted directly to mastering voices, but data submitted to other types of voices must be directed to a mastering voice to be heard.

inherits directly from , but does not implement methods specific to mastering voices. The interface type exists solely because some of the base class methods are implemented differently for mastering voices. Having a separate type for these voices helps client code to distinguish the different voice types and to benefit from C++ type safety.

microsoft.directx_sdk.ixaudio2masteringvoice.ixaudio2masteringvoice IXAudio2MasteringVoice IXAudio2MasteringVoice
Sets the volume level of each channel of the final output for the voice. These channels are mapped to the input channels of a specified destination voice.

This method is valid only for source and submix voices, because mastering voices write directly to the device with no matrix mixing.

Volume levels are expressed as floating-point amplitude multipliers between - and (-224 to 224), with a maximum gain of 144.5 dB. A volume level of 1.0 means there is no attenuation or gain and 0 means silence. Negative levels can be used to invert the audio's phase. See XAudio2 Volume and Pitch Control for additional information on volume control.

The X3DAudio function can produce an output matrix for use with SetOutputMatrix based on a sound's position and a listener's position.

Note
always returns the levels most recently set by . However, they may not actually be in effect yet: they only take effect the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).
ee418598 IXAudio2Voice IXAudio2Voice
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. Returns information about the creation flags, input channels, and sample rate of a voice.
[in, out] structure containing information about the voice.
ee418591 void IXAudio2Voice::GetVoiceDetails([Out] XAUDIO2_VOICE_DETAILS* pVoiceDetails) IXAudio2Voice::GetVoiceDetails
Designates a new set of submix or mastering voices to receive the output of the voice.
[in] Array of structure references to destination voices. If pSendList is null, the voice will send its output to the current mastering voice. To set the voice to not send its output anywhere set the OutputCount member of to 0. All of the voices in a send list must have the same input sample rate, see XAudio2 Sample Rate Conversions for additional information.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.

This method is only valid for source and submix voices. Mastering voices can not send audio to another voice.

After calling SetOutputVoices a voice's current send levels will be replaced by a default send matrix. The method must be called to set a custom matrix for the new sendlist.

It is illegal to call SetOutputVoices from within a callback. If SetOutputVoices is called within a callback XAUDIO2_E_INVALID_CALL will be returned.

Note
Calling SetOutputVoices invalidates any send matrices previously set with .
ee418599 HRESULT IXAudio2Voice::SetOutputVoices([In, Optional] const XAUDIO2_VOICE_SENDS* pSendList) IXAudio2Voice::SetOutputVoices
Replaces the effect chain of the voice.
[in, optional] Pointer to an structure that describes the new effect chain to use. If null is passed, the current effect chain is removed.
Note
If pEffectChain is non-null, the structure that it points to must specify at least one effect.

Returns if successful; otherwise, an error code.

See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.

The number of output channels allowed for a voice's effect chain is locked at creation of the voice. If you create the voice with an effect chain, any new effect chain passed to SetEffectChain must have the same number of input and output channels as the original effect chain. If you create the voice without an effect chain, the number of output channels allowed for the effect chain will default to the number of input channels for the voice. If any part of effect chain creation fails, none of it is applied.

After you attach an effect to an XAudio2 voice, XAudio2 takes control of the effect, and the client should not make any further calls to it. The simplest way to ensure this is to release all references to the effect.

It is illegal to call SetEffectChain from within a callback. If you call SetEffectChain within a callback, XAUDIO2_E_INVALID_CALL is returned.

The that is passed in as the pEffectChain argument and any information contained within it are no longer needed after SetEffectChain successfully completes, and may be deleted immediately after SetEffectChain is called.

microsoft.directx_sdk.ixaudio2voice.ixaudio2voice.seteffectchain HRESULT IXAudio2Voice::SetEffectChain([In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) IXAudio2Voice::SetEffectChain
Enables the effect at a given position in the effect chain of the voice.
[in] Zero-based index of an effect in the effect chain of the voice.
[in] Identifies this call as part of a deferred batch. See the XAudio2 Operation Sets overview for more information.

Returns if successful; otherwise, an error code. See XAudio2 Error Codes for descriptions of error codes.

Be careful when you enable an effect while the voice that hosts it is running. Such an action can result in a problem if the effect significantly changes the audio's pitch or volume.

The effects in a given XAudio2 voice's effect chain must consume and produce audio at that voice's processing sample rate. The only aspect of the audio format they can change is the channel count. For example a reverb effect can convert mono data to 5.1. The client can use the structure's OutputChannels field to specify the number of channels it wants each effect to produce. Each effect in an effect chain must produce a number of channels that the next effect can consume. Any calls to or that would make the effect chain stop fulfilling these requirements will fail.

EnableEffect takes effect immediately when you call it from an XAudio2 callback with an OperationSet of .

microsoft.directx_sdk.ixaudio2voice.ixaudio2voice.enableeffect HRESULT IXAudio2Voice::EnableEffect([In] unsigned int EffectIndex,[In] unsigned int OperationSet) IXAudio2Voice::EnableEffect
Disables the effect at a given position in the effect chain of the voice.
[in] Zero-based index of an effect in the effect chain of the voice.
[in] Identifies this call as part of a deferred batch. See the XAudio2 Operation Sets overview for more information.

Returns if successful; otherwise, an error code. See XAudio2 Error Codes for descriptions of valid error codes.

The effects in a given XAudio2 voice's effect chain must consume and produce audio at that voice's processing sample rate. The only aspect of the audio format they can change is the channel count. For example a reverb effect can convert mono data to 5.1. The client can use the structure's OutputChannels field to specify the number of channels it wants each effect to produce. Each effect in an effect chain must produce a number of channels that the next effect can consume. Any calls to or that would make the effect chain stop fulfilling these requirements will fail.

Disabling an effect immediately removes it from the processing graph. Any pending audio in the effect?such as a reverb tail?is not played. Be careful disabling an effect while the voice that hosts it is running. This can result in an audible artifact if the effect significantly changes the audio's pitch or volume.

DisableEffect takes effect immediately when called from an XAudio2 callback with an OperationSet of .

microsoft.directx_sdk.ixaudio2voice.ixaudio2voice.disableeffect HRESULT IXAudio2Voice::DisableEffect([In] unsigned int EffectIndex,[In] unsigned int OperationSet) IXAudio2Voice::DisableEffect
Returns the running state of the effect at a specified position in the effect chain of the voice.
[in] Zero-based index of an effect in the effect chain of the voice.

GetEffectState always returns the effect's actual current state. However, this may not be the state set by the most recent or call: the actual state is only changed the next time the audio engine runs after the or call (or after the corresponding call, if EnableEffect/DisableEffect was called with a deferred operation ID).

microsoft.directx_sdk.ixaudio2voice.ixaudio2voice.geteffectstate void IXAudio2Voice::GetEffectState([In] unsigned int EffectIndex,[Out] BOOL* pEnabled) IXAudio2Voice::GetEffectState
Sets parameters for a given effect in the voice's effect chain.
[in] Zero-based index of an effect within the voice's effect chain.
[in] Returns the current values of the effect-specific parameters.
[in] Size of the pParameters array in bytes.
[in] Identifies this call as part of a deferred batch. See the XAudio2 Operation Sets overview for more information.

Returns if successful; otherwise, an error code. See XAudio2 Error Codes for descriptions of error codes.

Fails with E_NOTIMPL if the effect does not support a generic parameter control interface.

The specific effect being used determines the valid size and format of the pParameters buffer. The call will fail if pParameters is invalid or if ParametersByteSize is not exactly the size that the effect expects. The client must take care to direct the SetEffectParameters call to the right effect. If this call is directed to a different effect that happens to accept the same parameter block size, the parameters will be interpreted differently. This may lead to unexpected results.

The memory pointed to by pParameters must not be freed immediately, because XAudio2 will need to refer to it later when the parameters actually are applied to the effect. This happens during the next audio processing pass if the OperationSet argument is . Otherwise, the parameters are applied to the effect later, during the first processing pass after the function is called with the same OperationSet argument.

SetEffectParameters takes effect immediately when called from an XAudio2 callback with an OperationSet of .

Note
always returns the effect's actual current parameters. However, these may not match the parameters set by the most recent call to . The actual parameters are only changed the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).
microsoft.directx_sdk.ixaudio2voice.ixaudio2voice.seteffectparameters HRESULT IXAudio2Voice::SetEffectParameters([In] unsigned int EffectIndex,[In, Buffer] const void* pParameters,[In] unsigned int ParametersByteSize,[In] unsigned int OperationSet) IXAudio2Voice::SetEffectParameters
Returns the current effect-specific parameters of a given effect in the voice's effect chain.
[in] Zero-based index of an effect within the voice's effect chain.
[out] Returns the current values of the effect-specific parameters.
[out] Size, in bytes, of the pParameters array.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of error codes.

Fails with E_NOTIMPL if the effect does not support a generic parameter control interface.

GetEffectParameters always returns the effect's actual current parameters. However, these may not match the parameters set by the most recent call to IXAudio2Voice::SetEffectParameters: the actual parameters are only changed the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).

microsoft.directx_sdk.ixaudio2voice.ixaudio2voice.geteffectparameters HRESULT IXAudio2Voice::GetEffectParameters([In] unsigned int EffectIndex,[Out, Buffer] void* pParameters,[In] unsigned int ParametersByteSize) IXAudio2Voice::GetEffectParameters
Sets the voice's filter parameters.
[in] Pointer to an structure containing the filter information.
[in] Identifies this call as part of a deferred batch. See the XAudio2 Operation Sets overview for more information.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of error codes.

SetFilterParameters will fail if the voice was not created with the flag.

This method is usable only on source and submix voices and has no effect on mastering voices.

Note
always returns this voice's actual current filter parameters. However, these may not match the parameters set by the most recent call: the actual parameters are only changed the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).
ee418596 HRESULT IXAudio2Voice::SetFilterParameters([In] const XAUDIO2_FILTER_PARAMETERS* pParameters,[In] unsigned int OperationSet) IXAudio2Voice::SetFilterParameters
Gets the voice's filter parameters.
[out] Pointer to an structure containing the filter information.

GetFilterParameters will fail if the voice was not created with the flag.

GetFilterParameters always returns this voice's actual current filter parameters. However, these may not match the parameters set by the most recent call: the actual parameters are only changed the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).

Note
GetFilterParameters is usable only on source and submix voices and has no effect on mastering voices.
ee418588 void IXAudio2Voice::GetFilterParameters([Out] XAUDIO2_FILTER_PARAMETERS* pParameters) IXAudio2Voice::GetFilterParameters
Sets the filter parameters on one of this voice's sends.
[in] reference to the destination voice of the send whose filter parameters will be set.
[in] Pointer to an structure containing the filter information.
[in] Identifies this call as part of a deferred batch. See the XAudio2 Operation Sets overview for more information.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of error codes.

SetOutputFilterParameters will fail if the send was not created with the XAUDIO2_SEND_USEFILTER flag. This method is usable only on sends belonging to source and submix voices and has no effect on a mastering voice's sends.

Note
always returns this send?s actual current filter parameters. However, these may not match the parameters set by the most recent call: the actual parameters are only changed the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).
ee418597 HRESULT IXAudio2Voice::SetOutputFilterParameters([In, Optional] IXAudio2Voice* pDestinationVoice,[In] const XAUDIO2_FILTER_PARAMETERS* pParameters,[In] unsigned int OperationSet) IXAudio2Voice::SetOutputFilterParameters
Returns the filter parameters from one of this voice's sends.
[in] reference to the destination voice of the send whose filter parameters will be read.
[out] Pointer to an structure containing the filter information.

GetOutputFilterParameters will fail if the send was not created with the XAUDIO2_SEND_USEFILTER flag. This method is usable only on sends belonging to source and submix voices and has no effect on mastering voices? sends.

Note
always returns this send?s actual current filter parameters. However, these may not match the parameters set by the most recent call: the actual parameters are only changed the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).
ee418589 void IXAudio2Voice::GetOutputFilterParameters([In, Optional] IXAudio2Voice* pDestinationVoice,[Out] XAUDIO2_FILTER_PARAMETERS* pParameters) IXAudio2Voice::GetOutputFilterParameters
Sets the overall volume level for the voice.
[in] Overall volume level to use. See Remarks for more information on volume levels.
[in] Identifies this call as part of a deferred batch. See the XAudio2 Operation Sets overview for more information.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of error codes.

SetVolume controls a voice's master input volume level. The master volume level is applied at different times depending on the type of voice. For submix and mastering voices the volume level is applied just before the voice's built in filter and effect chain is applied. For source voices the master volume level is applied after the voice's filter and effect chain is applied.

Volume levels are expressed as floating-point amplitude multipliers between - and (-224 to 224), with a maximum gain of 144.5 dB. A volume level of 1.0 means there is no attenuation or gain and 0 means silence. Negative levels can be used to invert the audio's phase. See XAudio2 Volume and Pitch Control for additional information on volume control.

Note
always returns the volume most recently set by . However, it may not actually be in effect yet: it only takes effect the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).
microsoft.directx_sdk.ixaudio2voice.ixaudio2voice.setvolume HRESULT IXAudio2Voice::SetVolume([In] float Volume,[In] unsigned int OperationSet) IXAudio2Voice::SetVolume
Gets the current overall volume level of the voice.
[out] Returns the current overall volume level of the voice. See Remarks for more information on volume levels.

Volume levels are expressed as floating-point amplitude multipliers between -224 to 224, with a maximum gain of 144.5 dB. A volume level of 1 means there is no attenuation or gain and 0 means silence. Negative levels can be used to invert the audio's phase. See XAudio2 Volume and Pitch Control for additional information on volume control.

Note
GetVolume always returns the volume most recently set by . However, it may not actually be in effect yet: it only takes effect the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).
microsoft.directx_sdk.ixaudio2voice.ixaudio2voice.getvolume void IXAudio2Voice::GetVolume([Out] float* pVolume) IXAudio2Voice::GetVolume
Sets the volume levels for the voice, per channel.
[in] Number of channels in the voice.
[in] Array containing the new volumes of each channel in the voice. The array must have Channels elements. See Remarks for more information on volume levels.
[in] Identifies this call as part of a deferred batch. See the XAudio2 Operation Sets overview for more information.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.

SetChannelVolumes controls a voice's per-channel output levels and is applied just after the voice's final SRC and before its sends.

This method is valid only for source and submix voices, because mastering voices do not specify volume per channel.

Volume levels are expressed as floating-point amplitude multipliers between - and (-224 to 224), with a maximum gain of 144.5 dB. A volume of 1 means there is no attenuation or gain and 0 means silence. Negative levels can be used to invert the audio's phase. See XAudio2 Volume and Pitch Control for additional information on volume control.

Note
always returns the volume levels most recently set by . However, those values may not actually be in effect yet: they only take effect the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).
ee418593 HRESULT IXAudio2Voice::SetChannelVolumes([In] unsigned int Channels,[In, Buffer] const float* pVolumes,[In] unsigned int OperationSet) IXAudio2Voice::SetChannelVolumes
Returns the volume levels for the voice, per channel.
[in] Confirms the channel count of the voice.
[out] Returns the current volume level of each channel in the voice. The array must have at least Channels elements. See Remarks for more information on volume levels.

These settings are applied after the effect chain is applied. This method is valid only for source and submix voices, because mastering voices do not specify volume per channel.

Volume levels are expressed as floating-point amplitude multipliers between -224 to 224, with a maximum gain of 144.5 dB. A volume of 1 means there is no attenuation or gain, 0 means silence, and negative levels can be used to invert the audio's phase. See XAudio2 Volume and Pitch Control for additional information on volume control.

Note
GetChannelVolumes always returns the volume levels most recently set by . However, those values may not actually be in effect yet: they only take effect the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).
ee418585 void IXAudio2Voice::GetChannelVolumes([In] unsigned int Channels,[Out, Buffer] float* pVolumes) IXAudio2Voice::GetChannelVolumes
Sets the volume level of each channel of the final output for the voice. These channels are mapped to the input channels of a specified destination voice.
[in] Pointer to a destination for which to set volume levels.
Note
If the voice sends to a single target voice then specifying null will cause SetOutputMatrix to operate on that target voice.
[in] Confirms the output channel count of the voice. This is the number of channels that are produced by the last effect in the chain.
[in] Confirms the input channel count of the destination voice.
[in] Array of [SourceChannels ? DestinationChannels] volume levels sent to the destination voice. The level sent from source channel S to destination channel D is specified in the form pLevelMatrix[SourceChannels ? D + S].

For example, when rendering two-channel stereo input into 5.1 output that is weighted toward the front channels?but is absent from the center and low-frequency channels?the matrix might have the values shown in the following table.

OutputLeft Input [Array Index]Right Input [Array Index]
Left1.0 [0]0.0 [1]
Right0.0 [2]1.0 [3]
Front Center0.0 [4]0.0 [5]
LFE0.0 [6]0.0 [7]
Rear Left0.8 [8]0.0 [9]
Rear Right0.0 [10]0.8 [11]

Note that the left and right input are fully mapped to the output left and right channels; 80 percent of the left and right input is mapped to the rear left and right channels.

See Remarks for more information on volume levels.

[in] Identifies this call as part of a deferred batch. See the XAudio2 Operation Sets overview for more information.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of error codes.

This method is valid only for source and submix voices, because mastering voices write directly to the device with no matrix mixing.

Volume levels are expressed as floating-point amplitude multipliers between - and (-224 to 224), with a maximum gain of 144.5 dB. A volume level of 1.0 means there is no attenuation or gain and 0 means silence. Negative levels can be used to invert the audio's phase. See XAudio2 Volume and Pitch Control for additional information on volume control.

The X3DAudio function can produce an output matrix for use with SetOutputMatrix based on a sound's position and a listener's position.

Note
always returns the levels most recently set by . However, they may not actually be in effect yet: they only take effect the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).
microsoft.directx_sdk.ixaudio2voice.ixaudio2voice.setoutputmatrix HRESULT IXAudio2Voice::SetOutputMatrix([In, Optional] IXAudio2Voice* pDestinationVoice,[In] unsigned int SourceChannels,[In] unsigned int DestinationChannels,[In, Buffer] const float* pLevelMatrix,[In] unsigned int OperationSet) IXAudio2Voice::SetOutputMatrix
Gets the volume level of each channel of the final output for the voice. These channels are mapped to the input channels of a specified destination voice.
[in] Pointer specifying the destination to retrieve the output matrix for.
Note
If the voice sends to a single target voice then specifying null will cause GetOutputMatrix to operate on that target voice.
[in] Confirms the output channel count of the voice. This is the number of channels that are produced by the last effect in the chain.
[in] Confirms the input channel count of the destination voice.
[out] Array of [SourceChannels * DestinationChannels] volume levels sent to the destination voice. The level sent from source channel S to destination channel D is returned in the form pLevelMatrix[DestinationChannels ? S + D]. See Remarks for more information on volume levels.

This method applies only to source and submix voices, because mastering voices write directly to the device with no matrix mixing.

Volume levels are expressed as floating-point amplitude multipliers between -224 to 224, with a maximum gain of 144.5 dB. A volume level of 1 means there is no attenuation or gain and 0 means silence. Negative levels can be used to invert the audio's phase. See XAudio2 Volume and Pitch Control for additional information on volume control.

See for information on standard channel ordering.

Note
GetOutputMatrix always returns the levels most recently set by . However, they may not actually be in effect yet: they only take effect the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).
ee418590 void IXAudio2Voice::GetOutputMatrix([In, Optional] IXAudio2Voice* pDestinationVoice,[In] unsigned int SourceChannels,[In] unsigned int DestinationChannels,[Out, Buffer] float* pLevelMatrix) IXAudio2Voice::GetOutputMatrix
Destroys the voice. If necessary, stops the voice and removes it from the XAudio2 graph.

If any other voice is currently sending audio to this voice, the method fails.

DestroyVoice waits for the audio processing thread to be idle, so it can take a little while (typically no more than a couple of milliseconds). This is necessary to guarantee that the voice will no longer make any callbacks or read any audio data, so the application can safely free up these resources as soon as the call returns.

To avoid title thread interruptions from a blocking DestroyVoice call, the application can destroy voices on a separate non-critical thread, or the application can use voice pooling strategies to reuse voices rather than destroying them. Note that voices can only be reused with audio that has the same data format and the same number of channels the voice was created with. A voice can play audio data with different sample rates than that of the voice by calling with an appropriate ratio parameter.

It is illegal to call DestroyVoice from within a callback. If DestroyVoice is called within a callback XAUDIO2_E_INVALID_CALL will be returned.

microsoft.directx_sdk.ixaudio2voice.ixaudio2voice.destroyvoice void IXAudio2Voice::DestroyVoice() IXAudio2Voice::DestroyVoice
Enables the effect at a given position in the effect chain of the voice. [in] Zero-based index of an effect in the effect chain of the voice. No documentation. HRESULT IXAudio2Voice::EnableEffect([None] UINT32 EffectIndex,[None] UINT32 OperationSet) Disables the effect at a given position in the effect chain of the voice. [in] Zero-based index of an effect in the effect chain of the voice. No documentation. HRESULT IXAudio2Voice::DisableEffect([None] UINT32 EffectIndex,[None] UINT32 OperationSet) Sets parameters for a given effect in the voice's effect chain. [in] Zero-based index of an effect within the voice's effect chain. Returns the current values of the effect-specific parameters. HRESULT IXAudio2Voice::SetEffectParameters([None] UINT32 EffectIndex,[In, Buffer] const void* pParameters,[None] UINT32 ParametersByteSize,[None] UINT32 OperationSet) Returns the current effect-specific parameters of a given effect in the voice's effect chain. [in] Zero-based index of an effect within the voice's effect chain. [out] Returns the current values of the effect-specific parameters. No documentation. HRESULT IXAudio2Voice::GetEffectParameters([None] UINT32 EffectIndex,[Out, Buffer] void* pParameters,[None] UINT32 ParametersByteSize) Sets parameters for a given effect in the voice's effect chain. [in] Zero-based index of an effect within the voice's effect chain. [in] Returns the current values of the effect-specific parameters. No documentation. HRESULT IXAudio2Voice::SetEffectParameters([None] UINT32 EffectIndex,[In, Buffer] const void* pParameters,[None] UINT32 ParametersByteSize,[None] UINT32 OperationSet) Sets parameters for a given effect in the voice's effect chain. [in] Zero-based index of an effect within the voice's effect chain. [in] Returns the current values of the effect-specific parameters. [in] Identifies this call as part of a deferred batch. See the {{XAudio2 Operation Sets}} overview for more information. No documentation. HRESULT IXAudio2Voice::SetEffectParameters([None] UINT32 EffectIndex,[In, Buffer] const void* pParameters,[None] UINT32 ParametersByteSize,[None] UINT32 OperationSet) Sets parameters for a given effect in the voice's effect chain. [in] Zero-based index of an effect within the voice's effect chain. [in] Returns the current values of the effect-specific parameters. No documentation. HRESULT IXAudio2Voice::SetEffectParameters([None] UINT32 EffectIndex,[In, Buffer] const void* pParameters,[None] UINT32 ParametersByteSize,[None] UINT32 OperationSet) Sets parameters for a given effect in the voice's effect chain. [in] Zero-based index of an effect within the voice's effect chain. [in] Returns the current values of the effect-specific parameters. [in] Identifies this call as part of a deferred batch. See the {{XAudio2 Operation Sets}} overview for more information. No documentation. HRESULT IXAudio2Voice::SetEffectParameters([None] UINT32 EffectIndex,[In, Buffer] const void* pParameters,[None] UINT32 ParametersByteSize,[None] UINT32 OperationSet) Replaces the effect chain of the voice. [in, optional] an array of structure that describes the new effect chain to use. If NULL is passed, the current effect chain is removed. If array is non null, its length must be at least of 1. No documentation. HRESULT IXAudio2Voice::SetEffectChain([In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) Designates a new set of submix or mastering voices to receive the output of the voice. [in] Array of structure pointers to destination voices. If outputVoices is NULL, the voice will send its output to the current mastering voice. To set the voice to not send its output anywhere set an array of lenvth 0. All of the voices in a send list must have the same input sample rate, see {{XAudio2 Sample Rate Conversions}} for additional information. No documentation. HRESULT IXAudio2Voice::SetOutputVoices([In, Optional] const XAUDIO2_VOICE_SENDS* pSendList) Sets the volume level of each channel of the final output for the voice. These channels are mapped to the input channels of a specified destination voice. [in] Confirms the output channel count of the voice. This is the number of channels that are produced by the last effect in the chain. [in] Confirms the input channel count of the destination voice. [in] Array of [SourceChannels ? DestinationChannels] volume levels sent to the destination voice. The level sent from source channel S to destination channel D is specified in the form pLevelMatrix[SourceChannels ? D + S]. For example, when rendering two-channel stereo input into 5.1 output that is weighted toward the front channels?but is absent from the center and low-frequency channels?the matrix might have the values shown in the following table. OutputLeft InputRight Input Left1.00.0 Right0.01.0 Front Center0.00.0 LFE0.00.0 Rear Left0.80.0 Rear Right0.00.8 Note that the left and right input are fully mapped to the output left and right channels; 80 percent of the left and right input is mapped to the rear left and right channels. See Remarks for more information on volume levels. No documentation. HRESULT IXAudio2Voice::SetOutputMatrix([In, Optional] IXAudio2Voice* pDestinationVoice,[None] UINT32 SourceChannels,[None] UINT32 DestinationChannels,[In, Buffer] const float* pLevelMatrix,[None] UINT32 OperationSet) Sets the volume level of each channel of the final output for the voice. These channels are mapped to the input channels of a specified destination voice. [in] Pointer to a destination for which to set volume levels. Note If the voice sends to a single target voice then specifying NULL will cause SetOutputMatrix to operate on that target voice. [in] Confirms the output channel count of the voice. This is the number of channels that are produced by the last effect in the chain. [in] Confirms the input channel count of the destination voice. [in] Array of [SourceChannels ? DestinationChannels] volume levels sent to the destination voice. The level sent from source channel S to destination channel D is specified in the form pLevelMatrix[SourceChannels ? D + S]. For example, when rendering two-channel stereo input into 5.1 output that is weighted toward the front channels?but is absent from the center and low-frequency channels?the matrix might have the values shown in the following table. OutputLeft InputRight Input Left1.00.0 Right0.01.0 Front Center0.00.0 LFE0.00.0 Rear Left0.80.0 Rear Right0.00.8 Note that the left and right input are fully mapped to the output left and right channels; 80 percent of the left and right input is mapped to the rear left and right channels. See Remarks for more information on volume levels. No documentation. HRESULT IXAudio2Voice::SetOutputMatrix([In, Optional] IXAudio2Voice* pDestinationVoice,[None] UINT32 SourceChannels,[None] UINT32 DestinationChannels,[In, Buffer] const float* pLevelMatrix,[None] UINT32 OperationSet) Sets the volume level of each channel of the final output for the voice. These channels are mapped to the input channels of a specified destination voice. [in] Confirms the output channel count of the voice. This is the number of channels that are produced by the last effect in the chain. [in] Confirms the input channel count of the destination voice. [in] Array of [SourceChannels ? DestinationChannels] volume levels sent to the destination voice. The level sent from source channel S to destination channel D is specified in the form pLevelMatrix[SourceChannels ? D + S]. For example, when rendering two-channel stereo input into 5.1 output that is weighted toward the front channels?but is absent from the center and low-frequency channels?the matrix might have the values shown in the following table. OutputLeft InputRight Input Left1.00.0 Right0.01.0 Front Center0.00.0 LFE0.00.0 Rear Left0.80.0 Rear Right0.00.8 Note that the left and right input are fully mapped to the output left and right channels; 80 percent of the left and right input is mapped to the rear left and right channels. See Remarks for more information on volume levels. [in] Identifies this call as part of a deferred batch. See the {{XAudio2 Operation Sets}} overview for more information. No documentation. HRESULT IXAudio2Voice::SetOutputMatrix([In, Optional] IXAudio2Voice* pDestinationVoice,[None] UINT32 SourceChannels,[None] UINT32 DestinationChannels,[In, Buffer] const float* pLevelMatrix,[None] UINT32 OperationSet) Returns information about the creation flags, input channels, and sample rate of a voice. ee418591 GetVoiceDetails GetVoiceDetails void IXAudio2Voice::GetVoiceDetails([Out] XAUDIO2_VOICE_DETAILS* pVoiceDetails) Designates a new set of submix or mastering voices to receive the output of the voice.

This method is only valid for source and submix voices. Mastering voices can not send audio to another voice.

After calling SetOutputVoices a voice's current send levels will be replaced by a default send matrix. The method must be called to set a custom matrix for the new sendlist.

It is illegal to call SetOutputVoices from within a callback. If SetOutputVoices is called within a callback XAUDIO2_E_INVALID_CALL will be returned.

Note
Calling SetOutputVoices invalidates any send matrices previously set with .
ee418599 SetOutputVoices SetOutputVoices HRESULT IXAudio2Voice::SetOutputVoices([In, Optional] const XAUDIO2_VOICE_SENDS* pSendList)
Gets the voice's filter parameters.

GetFilterParameters will fail if the voice was not created with the flag.

GetFilterParameters always returns this voice's actual current filter parameters. However, these may not match the parameters set by the most recent call: the actual parameters are only changed the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).

Note
GetFilterParameters is usable only on source and submix voices and has no effect on mastering voices.
ee418588 GetFilterParameters GetFilterParameters void IXAudio2Voice::GetFilterParameters([Out] XAUDIO2_FILTER_PARAMETERS* pParameters)
Gets the current overall volume level of the voice.

Volume levels are expressed as floating-point amplitude multipliers between -224 to 224, with a maximum gain of 144.5 dB. A volume level of 1 means there is no attenuation or gain and 0 means silence. Negative levels can be used to invert the audio's phase. See XAudio2 Volume and Pitch Control for additional information on volume control.

Note
GetVolume always returns the volume most recently set by . However, it may not actually be in effect yet: it only takes effect the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).
microsoft.directx_sdk.ixaudio2voice.ixaudio2voice.getvolume GetVolume GetVolume void IXAudio2Voice::GetVolume([Out] float* pVolume)
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. No documentation. No documentation. No documentation. HRESULT IXAudio2MasteringVoice::GetChannelMask([Out] unsigned int* pChannelmask) IXAudio2MasteringVoice::GetChannelMask Creates and configures a mastering voice. an instance of [in] Number of channels the mastering voice expects in its input audio. InputChannels must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. InputChannels can be set to XAUDIO2_DEFAULT_CHANNELS, with the default being determined by the current platform. Windows Attempts to detect the system speaker configuration setup. Xbox 360 Defaults to 5.1 surround. [in] Sample rate of the input audio data of the mastering voice. This rate must be a multiple of XAUDIO2_QUANTUM_DENOMINATOR. InputSampleRate must be between XAUDIO2_MIN_SAMPLE_RATE and XAUDIO2_MAX_SAMPLE_RATE. InputSampleRate can be set to XAUDIO2_DEFAULT_SAMPLERATE, with the default being determined by the current platform. Windows Windows XP defaults to 44100. Windows Vista and Windows 7 default to the setting specified in the Sound Control Panel. The default for this setting is 44100 (or 48000 if required by the driver). Xbox 360 Defaults to 48000. [in] Index of the output device that will be sent input by the mastering voice. Specifying the default value of 0 causes XAudio2 to select the global default audio device. HRESULT IXAudio2::CreateMasteringVoice([Out] IXAudio2MasteringVoice** ppMasteringVoice,[None] UINT32 InputChannels,[None] UINT32 InputSampleRate,[None] UINT32 Flags,[None] UINT32 DeviceIndex,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) No documentation. GetChannelMask GetChannelMask HRESULT IXAudio2MasteringVoice::GetChannelMask([Out] unsigned int* pChannelmask) Use a source voice to submit audio data to the XAudio2 processing pipeline. You must send voice data to a mastering voice to be heard, either directly or through intermediate submix voices.

inherits directly from . It implements its own methods.

microsoft.directx_sdk.ixaudio2sourcevoice.ixaudio2sourcevoice IXAudio2SourceVoice IXAudio2SourceVoice
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. Starts consumption and processing of audio by the voice. Delivers the result to any connected submix or mastering voices, or to the output device.
[in] Flags that control how the voice is started. Must be 0.
[in] Identifies this call as part of a deferred batch. See the XAudio2 Operation Sets overview for more information.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.

If the XAudio2 engine is stopped, the voice stops running. However, it remains in the started state, so that it starts running again as soon as the engine starts.

When first created, source voices are in the stopped state. Submix and mastering voices are in the started state.

After Start is called it has no further effect if called again before is called. In addition multiple calls to Start without matching calls to will result in warning messages in debug builds.

microsoft.directx_sdk.ixaudio2sourcevoice.ixaudio2sourcevoice.start HRESULT IXAudio2SourceVoice::Start([In] unsigned int Flags,[In] unsigned int OperationSet) IXAudio2SourceVoice::Start
Stops consumption of audio by the current voice.
[in] Flags that control how the voice is stopped. Can be 0 or the following:
ValueDescription
Continue emitting effect output after the voice is stopped.?
[in] Identifies this call as part of a deferred batch. See the XAudio2 Operation Sets overview for more information.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.

All source buffers that are queued on the voice and the current cursor position are preserved. This allows the voice to continue from where it left off, when it is restarted. The method can be used to flush queued source buffers.

By default, any pending output from voice effects?for example, reverb tails?is not played. Instead, the voice is immediately rendered silent. The flag can be used to continue emitting effect output after the voice stops running.

A voice stopped with the flag stops consuming source buffers, but continues to process its effects and send audio to its destination voices. A voice in this state can later be stopped completely by calling Stop again with the Flags argument set to 0. This enables stopping a voice with , waiting sufficient time for any audio being produced by its effects to finish, and then fully stopping the voice by calling Stop again without . This technique allows voices with effects to be stopped gracefully while ensuring idle voices will not continue to be processed after they have finished producing audio.

Stop is always asynchronous, even if called within a callback.

Note
XAudio2 never calls any voice callbacks for a voice if the voice is stopped (even if it was stopped with ).
microsoft.directx_sdk.ixaudio2sourcevoice.ixaudio2sourcevoice.stop HRESULT IXAudio2SourceVoice::Stop([In] XAUDIO2_PLAY_FLAGS Flags,[In] unsigned int OperationSet) IXAudio2SourceVoice::Stop
Adds a new audio buffer to the voice queue.
[in] Pointer to an structure to queue.
[in] Pointer to an additional structure used when submitting WMA data.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.

The voice processes and plays back the buffers in its queue in the order that they were submitted.

The structure includes details about the audio buffer's location and size, the part of the buffer that should actually be played, the loop region (if any) and loop count, the context reference to be used in any callbacks relating to this buffer, and an optional flag that indicates that it is the last buffer of a contiguous sound.

If the voice is started and has no buffers queued, the new buffer will start playing immediately. If the voice is stopped, the buffer is added to the voice's queue and will be played when the voice starts.

If only part of the given buffer should be played, the PlayBegin and PlayLength fields in the can be used to specify the region to be played. A PlayLength value of 0 means to play the entire buffer (and in this case PlayBegin must be 0 as well).

If all or part of the buffer should be played in a continuous loop, the LoopBegin, LoopLength and LoopCount fields in can be used to specify the characteristics of the loop region. A LoopBegin value of means that no looping should be performed, and in this case LoopLength and LoopCount must be given as 0. If a loop region is specified, it must be non-empty (LoopLength > 0), and the loop count must be between 1 and inclusive (or to specify an endless loop which will only end when is called). A loop count of N means to skip backwards N times, i.e. to play the loop region N+1 times.

If an explicit play region is specified, it must begin and end within the given audio buffer (or, in the compressed case, within the set of samples that the buffer will decode to). In addition, the loop region cannot end past the end of the play region.

Xbox 360

For certain audio formats, there may be additional restrictions on the valid endpoints of any play or loop regions; e.g. for XMA buffers, the regions can only begin or end at 128-sample boundaries in the decoded audio.

The pBuffer reference can be reused or freed immediately after calling this method, but the actual audio data referenced by pBuffer must remain valid until the buffer has been fully consumed by XAudio2 (which is indicated by the callback).

Up to buffers can be queued on a voice at any one time.

SubmitSourceBuffer takes effect immediately when called from an XAudio2 callback with an OperationSet of .

Xbox 360

This method can be called from an Xbox system thread (most other XAudio2 methods cannot). However, a maximum of two source buffers can be submitted from a system thread at a time.

microsoft.directx_sdk.ixaudio2sourcevoice.ixaudio2sourcevoice.submitsourcebuffer HRESULT IXAudio2SourceVoice::SubmitSourceBuffer([In] const XAUDIO2_BUFFER* pBuffer,[In] const void* pBufferWMA) IXAudio2SourceVoice::SubmitSourceBuffer
Removes all pending audio buffers from the voice queue. Returns if successful, an error code otherwise.

If the voice is started, the buffer that is currently playing is not removed from the queue.

FlushSourceBuffers can be called regardless of whether the voice is currently started or stopped.

For every buffer removed, an OnBufferEnd callback will be made, but none of the other per-buffer callbacks (OnBufferStart, OnStreamEnd or OnLoopEnd) will be made.

FlushSourceBuffers does not change a the voice's running state, so if the voice was playing a buffer prior to the call, it will continue to do so, and will deliver all the callbacks for the buffer normally. This means that the OnBufferEnd callback for this buffer will take place after the OnBufferEnd callbacks for the buffers that were removed. Thus, an XAudio2 client that calls FlushSourceBuffers cannot expect to receive OnBufferEnd callbacks in the order in which the buffers were submitted.

No warnings for starvation of the buffer queue will be emitted when the currently playing buffer completes; it is assumed that the client has intentionally removed the buffers that followed it. However, there may be an audio pop if this buffer does not end at a zero crossing. If the application must ensure that the flush operation takes place while a specific buffer is playing?perhaps because the buffer ends with a zero crossing?it must call FlushSourceBuffers from a callback, so that it executes synchronously.

Calling FlushSourceBuffers after a voice is stopped and then submitting new data to the voice resets all of the voice's internal counters.

A voice's state is not considered reset after calling FlushSourceBuffers until the OnBufferEnd callback occurs (if a buffer was previously submitted) or returns with .BuffersQueued == 0. For example, if you stop a voice and call FlushSourceBuffers, it's still not legal to immediately call (which requires the voice to not have any buffers currently queued), until either of the previously mentioned conditions are met.

ee418466 HRESULT IXAudio2SourceVoice::FlushSourceBuffers() IXAudio2SourceVoice::FlushSourceBuffers
Notifies an XAudio2 voice that no more buffers are coming after the last one that is currently in its queue. Returns if successful, an error code otherwise.

Discontinuity suppresses the warnings that normally occur in the debug build of XAudio2 when a voice runs out of audio buffers to play. It is preferable to mark the final buffer of a stream by tagging it with the flag, but in some cases the client may not know that a buffer is the end of a stream until after the buffer has been submitted.

Because calling Discontinuity is equivalent to applying the flag retroactively to the last buffer submitted, an OnStreamEnd callback will be made when this buffer completes.

Note
XAudio2 may consume its entire buffer queue and emit a warning before the Discontinuity call takes effect, so Discontinuity is not guaranteed to suppress the warnings.
microsoft.directx_sdk.ixaudio2sourcevoice.ixaudio2sourcevoice.discontinuity HRESULT IXAudio2SourceVoice::Discontinuity() IXAudio2SourceVoice::Discontinuity
Stops looping the voice when it reaches the end of the current loop region.
[in] Identifies this call as part of a deferred batch. See the XAudio2 Operation Sets overview for more information.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.

If the cursor for the voice is not in a loop region, ExitLoop does nothing.

ee418465 HRESULT IXAudio2SourceVoice::ExitLoop([In] unsigned int OperationSet) IXAudio2SourceVoice::ExitLoop

Returns the voice's current cursor position data.

No documentation.

If a client needs to obtain the correlated positions of several voices (i.e. to know exactly which sample of a given voice is playing when a given sample of another voice is playing) it must make GetState calls in an XAudio2 engine callback, to ensure that none of the voices advance while the calls are being made. See the XAudio2 Callbacks overview for information about using XAudio2 callbacks.

microsoft.directx_sdk.ixaudio2sourcevoice.ixaudio2sourcevoice.getstate void IXAudio2SourceVoice::GetState([Out] XAUDIO2_VOICE_STATE* pVoiceState,[In] unsigned int Flags) IXAudio2SourceVoice::GetState
Sets the frequency adjustment ratio of the voice.
[in] Frequency adjustment ratio. This value must be between and the MaxFrequencyRatio parameter specified when the voice was created (see ). currently is 0.0005, which allows pitch to be lowered by up to 11 octaves.
[in] Identifies this call as part of a deferred batch. See the XAudio2 Operation Sets overview for more information.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of error codes.

Frequency adjustment is expressed as source frequency / target frequency. Changing the frequency ratio changes the rate audio is played on the voice. A ratio greater than 1.0 will cause the audio to play faster and a ratio less than 1.0 will cause the audio to play slower. Additionally, the frequency ratio affects the pitch of audio on the voice. As an example, a value of 1.0 has no effect on the audio, whereas a value of 2.0 raises pitch by one octave and 0.5 lowers it by one octave.

If SetFrequencyRatio is called specifying a Ratio value outside the valid range, the method will set the frequency ratio to the nearest valid value. A warning also will be generated for debug builds.

Note
always returns the voice's actual current frequency ratio. However, this may not match the ratio set by the most recent call: the actual ratio is only changed the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).
ee418469 HRESULT IXAudio2SourceVoice::SetFrequencyRatio([In] float Ratio,[In] unsigned int OperationSet) IXAudio2SourceVoice::SetFrequencyRatio
Returns the frequency adjustment ratio of the voice.
[out] Returns the current frequency adjustment ratio if successful.

GetFrequencyRatio always returns the voice's actual current frequency ratio. However, this may not match the ratio set by the most recent call: the actual ratio is only changed the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).

For information on frequency ratios, see .

ee418467 void IXAudio2SourceVoice::GetFrequencyRatio([Out] float* pRatio) IXAudio2SourceVoice::GetFrequencyRatio
Reconfigures the voice to consume source data at a different sample rate than the rate specified when the voice was created.
[in] The new sample rate the voice should process submitted data at. Valid sample rates are 1kHz to 200kHz.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of error codes.

The SetSourceSampleRate method supports reuse of XAudio2 voices by allowing a voice to play sounds with a variety of sample rates. To use SetSourceSampleRate the voice must have been created without the or flags and must not have any buffers currently queued.

The typical use of SetSourceSampleRate is to support voice pooling. For example to support voice pooling an application would precreate all the voices it expects to use. Whenever a new sound will be played the application chooses an inactive voice or ,if all voices are busy, picks the least important voice and calls SetSourceSampleRate on the voice with the new sound's sample rate. After SetSourceSampleRate has been called on the voice, the application can immediately start submitting and playing buffers with the new sample rate. This allows the application to avoid the overhead of creating and destroying voices frequently during gameplay.

ee418470 HRESULT IXAudio2SourceVoice::SetSourceSampleRate([In] unsigned int NewSourceSampleRate) IXAudio2SourceVoice::SetSourceSampleRate
Creates and configures a source voice. an instance of [in] Pointer to a structure. This structure contains the expected format for all audio buffers submitted to the source voice. XAudio2 supports voice types of PCM, xWMA, ADPCM (Windows only), and XMA (Xbox 360 only). XAudio2 supports the following PCM formats. 8-bit (unsigned) integer PCM 16-bit integer PCM (Optimal format for XAudio2) 20-bit integer PCM (either in 24 or 32 bit containers) 24-bit integer PCM (either in 24 or 32 bit containers) 32-bit integer PCM 32-bit float PCM (Preferred format after 16-bit integer) The number of channels in a source voice must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. The sample rate of a source voice must be between XAUDIO2_MIN_SAMPLE_RATE and XAUDIO2_MAX_SAMPLE_RATE. Note Data formats such as XMA, {{ADPCM}}, and {{xWMA}} that require more information than provided by have a structure as the first member in their format structure. When creating a source voice with one of those formats cast the format's structure as a structure and use it as the value for pSourceFormat. No documentation. HRESULT IXAudio2::CreateSourceVoice([Out] IXAudio2SourceVoice** ppSourceVoice,[In] const WAVEFORMATEX* pSourceFormat,[None] UINT32 Flags,[None] float MaxFrequencyRatio,[In, Optional] IXAudio2VoiceCallback* pCallback,[In, Optional] const XAUDIO2_VOICE_SENDS* pSendList,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) Creates and configures a source voice. an instance of [in] Pointer to a structure. This structure contains the expected format for all audio buffers submitted to the source voice. XAudio2 supports voice types of PCM, xWMA, ADPCM (Windows only), and XMA (Xbox 360 only). XAudio2 supports the following PCM formats. 8-bit (unsigned) integer PCM 16-bit integer PCM (Optimal format for XAudio2) 20-bit integer PCM (either in 24 or 32 bit containers) 24-bit integer PCM (either in 24 or 32 bit containers) 32-bit integer PCM 32-bit float PCM (Preferred format after 16-bit integer) The number of channels in a source voice must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. The sample rate of a source voice must be between XAUDIO2_MIN_SAMPLE_RATE and XAUDIO2_MAX_SAMPLE_RATE. Note Data formats such as XMA, {{ADPCM}}, and {{xWMA}} that require more information than provided by have a structure as the first member in their format structure. When creating a source voice with one of those formats cast the format's structure as a structure and use it as the value for pSourceFormat. True to enable delegate callbacks on this instance. Default is false No documentation. HRESULT IXAudio2::CreateSourceVoice([Out] IXAudio2SourceVoice** ppSourceVoice,[In] const WAVEFORMATEX* pSourceFormat,[None] UINT32 Flags,[None] float MaxFrequencyRatio,[In, Optional] IXAudio2VoiceCallback* pCallback,[In, Optional] const XAUDIO2_VOICE_SENDS* pSendList,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) Creates and configures a source voice. an instance of [in] Pointer to a structure. This structure contains the expected format for all audio buffers submitted to the source voice. XAudio2 supports voice types of PCM, xWMA, ADPCM (Windows only), and XMA (Xbox 360 only). XAudio2 supports the following PCM formats. 8-bit (unsigned) integer PCM 16-bit integer PCM (Optimal format for XAudio2) 20-bit integer PCM (either in 24 or 32 bit containers) 24-bit integer PCM (either in 24 or 32 bit containers) 32-bit integer PCM 32-bit float PCM (Preferred format after 16-bit integer) The number of channels in a source voice must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. The sample rate of a source voice must be between XAUDIO2_MIN_SAMPLE_RATE and XAUDIO2_MAX_SAMPLE_RATE. Note Data formats such as XMA, {{ADPCM}}, and {{xWMA}} that require more information than provided by have a structure as the first member in their format structure. When creating a source voice with one of those formats cast the format's structure as a structure and use it as the value for pSourceFormat. [in] Flags that specify the behavior of the source voice. A flag can be 0 or a combination of one or more of the following: ValueDescriptionXAUDIO2_VOICE_NOPITCHNo pitch control is available on the voice.?XAUDIO2_VOICE_NOSRCNo sample rate conversion is available on the voice, the voice's outputs must have the same sample rate.Note The XAUDIO2_VOICE_NOSRC flag causes the voice to behave as though the XAUDIO2_VOICE_NOPITCH flag also is specified. ?XAUDIO2_VOICE_USEFILTERThe filter effect should be available on this voice.?XAUDIO2_VOICE_MUSICThe voice is used to play background music. The system automatically can replace the voice with music selected by the user.? No documentation. HRESULT IXAudio2::CreateSourceVoice([Out] IXAudio2SourceVoice** ppSourceVoice,[In] const WAVEFORMATEX* pSourceFormat,[None] UINT32 Flags,[None] float MaxFrequencyRatio,[In, Optional] IXAudio2VoiceCallback* pCallback,[In, Optional] const XAUDIO2_VOICE_SENDS* pSendList,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) Creates and configures a source voice. an instance of [in] Pointer to a structure. This structure contains the expected format for all audio buffers submitted to the source voice. XAudio2 supports voice types of PCM, xWMA, ADPCM (Windows only), and XMA (Xbox 360 only). XAudio2 supports the following PCM formats. 8-bit (unsigned) integer PCM 16-bit integer PCM (Optimal format for XAudio2) 20-bit integer PCM (either in 24 or 32 bit containers) 24-bit integer PCM (either in 24 or 32 bit containers) 32-bit integer PCM 32-bit float PCM (Preferred format after 16-bit integer) The number of channels in a source voice must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. The sample rate of a source voice must be between XAUDIO2_MIN_SAMPLE_RATE and XAUDIO2_MAX_SAMPLE_RATE. Note Data formats such as XMA, {{ADPCM}}, and {{xWMA}} that require more information than provided by have a structure as the first member in their format structure. When creating a source voice with one of those formats cast the format's structure as a structure and use it as the value for pSourceFormat. [in] Flags that specify the behavior of the source voice. A flag can be 0 or a combination of one or more of the following: ValueDescriptionXAUDIO2_VOICE_NOPITCHNo pitch control is available on the voice.?XAUDIO2_VOICE_NOSRCNo sample rate conversion is available on the voice, the voice's outputs must have the same sample rate.Note The XAUDIO2_VOICE_NOSRC flag causes the voice to behave as though the XAUDIO2_VOICE_NOPITCH flag also is specified. ?XAUDIO2_VOICE_USEFILTERThe filter effect should be available on this voice.?XAUDIO2_VOICE_MUSICThe voice is used to play background music. The system automatically can replace the voice with music selected by the user.? True to enable delegate callbacks on this instance. Default is false No documentation. HRESULT IXAudio2::CreateSourceVoice([Out] IXAudio2SourceVoice** ppSourceVoice,[In] const WAVEFORMATEX* pSourceFormat,[None] UINT32 Flags,[None] float MaxFrequencyRatio,[In, Optional] IXAudio2VoiceCallback* pCallback,[In, Optional] const XAUDIO2_VOICE_SENDS* pSendList,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) Creates and configures a source voice. an instance of [in] Pointer to a structure. This structure contains the expected format for all audio buffers submitted to the source voice. XAudio2 supports voice types of PCM, xWMA, ADPCM (Windows only), and XMA (Xbox 360 only). XAudio2 supports the following PCM formats. 8-bit (unsigned) integer PCM 16-bit integer PCM (Optimal format for XAudio2) 20-bit integer PCM (either in 24 or 32 bit containers) 24-bit integer PCM (either in 24 or 32 bit containers) 32-bit integer PCM 32-bit float PCM (Preferred format after 16-bit integer) The number of channels in a source voice must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. The sample rate of a source voice must be between XAUDIO2_MIN_SAMPLE_RATE and XAUDIO2_MAX_SAMPLE_RATE. Note Data formats such as XMA, {{ADPCM}}, and {{xWMA}} that require more information than provided by have a structure as the first member in their format structure. When creating a source voice with one of those formats cast the format's structure as a structure and use it as the value for pSourceFormat. [in] Flags that specify the behavior of the source voice. A flag can be 0 or a combination of one or more of the following: ValueDescriptionXAUDIO2_VOICE_NOPITCHNo pitch control is available on the voice.?XAUDIO2_VOICE_NOSRCNo sample rate conversion is available on the voice, the voice's outputs must have the same sample rate.Note The XAUDIO2_VOICE_NOSRC flag causes the voice to behave as though the XAUDIO2_VOICE_NOPITCH flag also is specified. ?XAUDIO2_VOICE_USEFILTERThe filter effect should be available on this voice.?XAUDIO2_VOICE_MUSICThe voice is used to play background music. The system automatically can replace the voice with music selected by the user.? [in] Highest allowable frequency ratio that can be set on this voice. The value for this argument must be between XAUDIO2_MIN_FREQ_RATIO and XAUDIO2_MAX_FREQ_RATIO. Subsequent calls to are clamped between XAUDIO2_MIN_FREQ_RATIO and MaxFrequencyRatio. The maximum value for this argument is defined as XAUDIO2_MAX_FREQ_RATIO, which allows pitch to be raised by up to 10 octaves. If MaxFrequencyRatio is less than 1.0, the voice will use that ratio immediately after being created (rather than the default of 1.0). Xbox 360 For XMA voices there is an additional restriction on the MaxFrequencyRatio argument and the voice's sample rate. The product of these two numbers cannot exceed XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MONO for one-channel voices or XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MULTICHANNEL for voices with any other number of channels. If the value specified for MaxFrequencyRatio is too high for the specified format, the call to CreateSourceVoice fails and produces a debug message. Note XAudio2's memory usage can be reduced by using the lowest possible MaxFrequencyRatio value. No documentation. HRESULT IXAudio2::CreateSourceVoice([Out] IXAudio2SourceVoice** ppSourceVoice,[In] const WAVEFORMATEX* pSourceFormat,[None] UINT32 Flags,[None] float MaxFrequencyRatio,[In, Optional] IXAudio2VoiceCallback* pCallback,[In, Optional] const XAUDIO2_VOICE_SENDS* pSendList,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) Creates and configures a source voice. an instance of [in] Pointer to a structure. This structure contains the expected format for all audio buffers submitted to the source voice. XAudio2 supports voice types of PCM, xWMA, ADPCM (Windows only), and XMA (Xbox 360 only). XAudio2 supports the following PCM formats. 8-bit (unsigned) integer PCM 16-bit integer PCM (Optimal format for XAudio2) 20-bit integer PCM (either in 24 or 32 bit containers) 24-bit integer PCM (either in 24 or 32 bit containers) 32-bit integer PCM 32-bit float PCM (Preferred format after 16-bit integer) The number of channels in a source voice must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. The sample rate of a source voice must be between XAUDIO2_MIN_SAMPLE_RATE and XAUDIO2_MAX_SAMPLE_RATE. Note Data formats such as XMA, {{ADPCM}}, and {{xWMA}} that require more information than provided by have a structure as the first member in their format structure. When creating a source voice with one of those formats cast the format's structure as a structure and use it as the value for pSourceFormat. [in] Flags that specify the behavior of the source voice. A flag can be 0 or a combination of one or more of the following: ValueDescriptionXAUDIO2_VOICE_NOPITCHNo pitch control is available on the voice.?XAUDIO2_VOICE_NOSRCNo sample rate conversion is available on the voice, the voice's outputs must have the same sample rate.Note The XAUDIO2_VOICE_NOSRC flag causes the voice to behave as though the XAUDIO2_VOICE_NOPITCH flag also is specified. ?XAUDIO2_VOICE_USEFILTERThe filter effect should be available on this voice.?XAUDIO2_VOICE_MUSICThe voice is used to play background music. The system automatically can replace the voice with music selected by the user.? [in] Highest allowable frequency ratio that can be set on this voice. The value for this argument must be between XAUDIO2_MIN_FREQ_RATIO and XAUDIO2_MAX_FREQ_RATIO. Subsequent calls to are clamped between XAUDIO2_MIN_FREQ_RATIO and MaxFrequencyRatio. The maximum value for this argument is defined as XAUDIO2_MAX_FREQ_RATIO, which allows pitch to be raised by up to 10 octaves. If MaxFrequencyRatio is less than 1.0, the voice will use that ratio immediately after being created (rather than the default of 1.0). Xbox 360 For XMA voices there is an additional restriction on the MaxFrequencyRatio argument and the voice's sample rate. The product of these two numbers cannot exceed XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MONO for one-channel voices or XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MULTICHANNEL for voices with any other number of channels. If the value specified for MaxFrequencyRatio is too high for the specified format, the call to CreateSourceVoice fails and produces a debug message. Note XAudio2's memory usage can be reduced by using the lowest possible MaxFrequencyRatio value. [in, optional] Pointer to a client-provided callback interface, . No documentation. HRESULT IXAudio2::CreateSourceVoice([Out] IXAudio2SourceVoice** ppSourceVoice,[In] const WAVEFORMATEX* pSourceFormat,[None] UINT32 Flags,[None] float MaxFrequencyRatio,[In, Optional] IXAudio2VoiceCallback* pCallback,[In, Optional] const XAUDIO2_VOICE_SENDS* pSendList,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) Creates and configures a source voice with callback through delegates. an instance of [in] Pointer to a structure. This structure contains the expected format for all audio buffers submitted to the source voice. XAudio2 supports voice types of PCM, xWMA, ADPCM (Windows only), and XMA (Xbox 360 only). XAudio2 supports the following PCM formats. 8-bit (unsigned) integer PCM 16-bit integer PCM (Optimal format for XAudio2) 20-bit integer PCM (either in 24 or 32 bit containers) 24-bit integer PCM (either in 24 or 32 bit containers) 32-bit integer PCM 32-bit float PCM (Preferred format after 16-bit integer) The number of channels in a source voice must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. The sample rate of a source voice must be between XAUDIO2_MIN_SAMPLE_RATE and XAUDIO2_MAX_SAMPLE_RATE. Note Data formats such as XMA, {{ADPCM}}, and {{xWMA}} that require more information than provided by have a structure as the first member in their format structure. When creating a source voice with one of those formats cast the format's structure as a structure and use it as the value for pSourceFormat. [in] Flags that specify the behavior of the source voice. A flag can be 0 or a combination of one or more of the following: ValueDescriptionXAUDIO2_VOICE_NOPITCHNo pitch control is available on the voice.?XAUDIO2_VOICE_NOSRCNo sample rate conversion is available on the voice, the voice's outputs must have the same sample rate.Note The XAUDIO2_VOICE_NOSRC flag causes the voice to behave as though the XAUDIO2_VOICE_NOPITCH flag also is specified. ?XAUDIO2_VOICE_USEFILTERThe filter effect should be available on this voice.?XAUDIO2_VOICE_MUSICThe voice is used to play background music. The system automatically can replace the voice with music selected by the user.? [in] Highest allowable frequency ratio that can be set on this voice. The value for this argument must be between XAUDIO2_MIN_FREQ_RATIO and XAUDIO2_MAX_FREQ_RATIO. Subsequent calls to are clamped between XAUDIO2_MIN_FREQ_RATIO and MaxFrequencyRatio. The maximum value for this argument is defined as XAUDIO2_MAX_FREQ_RATIO, which allows pitch to be raised by up to 10 octaves. If MaxFrequencyRatio is less than 1.0, the voice will use that ratio immediately after being created (rather than the default of 1.0). Xbox 360 For XMA voices there is an additional restriction on the MaxFrequencyRatio argument and the voice's sample rate. The product of these two numbers cannot exceed XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MONO for one-channel voices or XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MULTICHANNEL for voices with any other number of channels. If the value specified for MaxFrequencyRatio is too high for the specified format, the call to CreateSourceVoice fails and produces a debug message. Note XAudio2's memory usage can be reduced by using the lowest possible MaxFrequencyRatio value. True to enable delegate callbacks on this instance. Default is false No enableCallbackEvents. HRESULT IXAudio2::CreateSourceVoice([Out] IXAudio2SourceVoice** ppSourceVoice,[In] const WAVEFORMATEX* pSourceFormat,[None] UINT32 Flags,[None] float MaxFrequencyRatio,[In, Optional] IXAudio2VoiceCallback* pCallback,[In, Optional] const XAUDIO2_VOICE_SENDS* pSendList,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) Starts consumption and processing of audio by the voice. Delivers the result to any connected submix or mastering voices, or to the output device, with CommitNow changes. No documentation. HRESULT IXAudio2SourceVoice::Start([None] UINT32 Flags,[None] UINT32 OperationSet) Sets the frequency ratio. The ratio. Starts consumption and processing of audio by the voice. Delivers the result to any connected submix or mastering voices, or to the output device. [in] Identifies this call as part of a deferred batch. See the {{XAudio2 Operation Sets}} overview for more information. No documentation. HRESULT IXAudio2SourceVoice::Start([None] UINT32 Flags,[None] UINT32 OperationSet) No documentation. No documentation. No documentation. No documentation. HRESULT IXAudio2SourceVoice::SubmitSourceBuffer([In] const XAUDIO2_BUFFER* pBuffer,[In, Optional] const XAUDIO2_BUFFER_WMA* pBufferWMA) Returns the frequency adjustment ratio of the voice.

GetFrequencyRatio always returns the voice's actual current frequency ratio. However, this may not match the ratio set by the most recent call: the actual ratio is only changed the next time the audio engine runs after the call (or after the corresponding call, if was called with a deferred operation ID).

For information on frequency ratios, see .

ee418467 GetFrequencyRatio GetFrequencyRatio void IXAudio2SourceVoice::GetFrequencyRatio([Out] float* pRatio)
Reconfigures the voice to consume source data at a different sample rate than the rate specified when the voice was created.

The SetSourceSampleRate method supports reuse of XAudio2 voices by allowing a voice to play sounds with a variety of sample rates. To use SetSourceSampleRate the voice must have been created without the or flags and must not have any buffers currently queued.

The typical use of SetSourceSampleRate is to support voice pooling. For example to support voice pooling an application would precreate all the voices it expects to use. Whenever a new sound will be played the application chooses an inactive voice or ,if all voices are busy, picks the least important voice and calls SetSourceSampleRate on the voice with the new sound's sample rate. After SetSourceSampleRate has been called on the voice, the application can immediately start submitting and playing buffers with the new sample rate. This allows the application to avoid the overhead of creating and destroying voices frequently during gameplay.

ee418470 SetSourceSampleRate SetSourceSampleRate HRESULT IXAudio2SourceVoice::SetSourceSampleRate([In] unsigned int NewSourceSampleRate)
Gets the state. Occurs just before the processing pass for the voice begins. In order to use this delegate, this instance must have been intialized with events delegate support. Occurs just after the processing pass for the voice ends. In order to use this delegate, this instance must have been intialized with events delegate support. Occurs when the voice has just finished playing a contiguous audio stream. In order to use this delegate, this instance must have been intialized with events delegate support. Occurs when the voice is about to start processing a new audio buffer. In order to use this delegate, this instance must have been intialized with events delegate support. Occurs when the voice finishes processing a buffer. In order to use this delegate, this instance must have been intialized with events delegate support. Occurs when a critical error occurs during voice processing. In order to use this delegate, this instance must have been intialized with events delegate support. Occurs when [voice error]. In order to use this delegate, this instance must have been intialized with events delegate support. Theinterface contains methods that notify the client when certain events happen in a givenIXAudio2SourceVoice. This interface should be implemented by the XAudio2 client. XAudio2 calls these methods through an interface reference provided by the client in theIXAudio2::CreateSourceVoicemethod. Methods in this interface returnvoid, rather than an .

See the XAudio2 Callbacks topic for restrictions on callback implementation.

microsoft.directx_sdk.ixaudio2voicecallback.ixaudio2voicecallback IXAudio2VoiceCallback IXAudio2VoiceCallback
Called during each processing pass for each voice, just before XAudio2 reads data from the voice's buffer queue. The number of bytes that must be submitted immediately to avoid starvation. This allows the implementation of just-in-time streaming scenarios; the client can keep the absolute minimum data queued on the voice at all times, and pass it fresh data just before the data is required. This model provides the lowest possible latency attainable with XAudio2. For xWMA and XMA data BytesRequired will always be zero, since the concept of a frame of xWMA or XMA data is meaningless. Note In a situation where there is always plenty of data available on the source voice, BytesRequired should always report zero, because it doesn't need any samples immediately to avoid glitching. void IXAudio2VoiceCallback::OnVoiceProcessingPassStart([None] UINT32 BytesRequired) Called just after the processing pass for the voice ends. void IXAudio2VoiceCallback::OnVoiceProcessingPassEnd() Called when the voice has just finished playing a contiguous audio stream. void IXAudio2VoiceCallback::OnStreamEnd() Called when the voice is about to start processing a new audio buffer. Context pointer that was assigned to the pContext member of the structure when the buffer was submitted. void IXAudio2VoiceCallback::OnBufferStart([None] void* pBufferContext) Called when the voice finishes processing a buffer. Context pointer assigned to the pContext member of the structure when the buffer was submitted. void IXAudio2VoiceCallback::OnBufferEnd([None] void* pBufferContext) Called when the voice reaches the end position of a loop. Context pointer that was assigned to the pContext member of the structure when the buffer was submitted. void IXAudio2VoiceCallback::OnLoopEnd([None] void* pBufferContext) Called when a critical error occurs during voice processing. Context pointer that was assigned to the pContext member of the structure when the buffer was submitted. The HRESULT code of the error encountered. void IXAudio2VoiceCallback::OnVoiceError([None] void* pBufferContext,[None] HRESULT Error) A submix voice is used primarily for performance improvements and effects processing. Data buffers cannot be submitted directly to submix voices and will not be audible unless submitted to a mastering voice. A submix voice can be used to ensure that a particular set of voice data is converted to the same format and/or to have a particular effect chain processed on the collective result.

inherits directly from , but does not implement methods specific to submix voices. The interface type exists solely because some of the base class methods are implemented differently for submix voices. Having a separate type for these voices helps client code to distinguish the different voice types and to benefit from C++ type safety.

microsoft.directx_sdk.ixaudio2submixvoice.ixaudio2submixvoice IXAudio2SubmixVoice IXAudio2SubmixVoice
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. Creates and configures a mastering voice on the default audio device, with stereo channels at 44100Hz. an instance of HRESULT IXAudio2::CreateSubmixVoice([Out] IXAudio2SubmixVoice** ppSubmixVoice,[None] UINT32 InputChannels,[None] UINT32 InputSampleRate,[None] UINT32 Flags,[None] UINT32 DeviceIndex,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) Creates and configures a mastering voice on the default audio device and 44100Hz. an instance of [in] Number of channels the mastering voice expects in its input audio. InputChannels must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. InputChannels can be set to XAUDIO2_DEFAULT_CHANNELS, with the default being determined by the current platform. Windows Attempts to detect the system speaker configuration setup. Xbox 360 Defaults to 5.1 surround. HRESULT IXAudio2::CreateSubmixVoice([Out] IXAudio2SubmixVoice** ppSubmixVoice,[None] UINT32 InputChannels,[None] UINT32 InputSampleRate,[None] UINT32 Flags,[None] UINT32 DeviceIndex,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) Creates and configures a mastering voice on the default audio device. an instance of [in] Number of channels the mastering voice expects in its input audio. InputChannels must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. InputChannels can be set to XAUDIO2_DEFAULT_CHANNELS, with the default being determined by the current platform. Windows Attempts to detect the system speaker configuration setup. Xbox 360 Defaults to 5.1 surround. [in] Sample rate of the input audio data of the mastering voice. This rate must be a multiple of XAUDIO2_QUANTUM_DENOMINATOR. InputSampleRate must be between XAUDIO2_MIN_SAMPLE_RATE and XAUDIO2_MAX_SAMPLE_RATE. InputSampleRate can be set to XAUDIO2_DEFAULT_SAMPLERATE, with the default being determined by the current platform. Windows Windows XP defaults to 44100. Windows Vista and Windows 7 default to the setting specified in the Sound Control Panel. The default for this setting is 44100 (or 48000 if required by the driver). Xbox 360 Defaults to 48000. HRESULT IXAudio2::CreateSubmixVoice([Out] IXAudio2SubmixVoice** ppSubmixVoice,[None] UINT32 InputChannels,[None] UINT32 InputSampleRate,[None] UINT32 Flags,[None] UINT32 DeviceIndex,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) Creates and configures a submix voice. an instance of [in] Number of channels in the input audio data of the submix voice. InputChannels must be less than or equal to XAUDIO2_MAX_AUDIO_CHANNELS. [in] Sample rate of the input audio data of submix voice. This rate must be a multiple of XAUDIO2_QUANTUM_DENOMINATOR. InputSampleRate must be between XAUDIO2_MIN_SAMPLE_RATE and XAUDIO2_MAX_SAMPLE_RATE. [in] Flags that specify the behavior of the submix voice. Can be 0 or the following: ValueDescriptionXAUDIO2_VOICE_USEFILTERThe filter effect should be available on this voice.? [in] An arbitrary number that specifies when this voice is processed with respect to other submix voices, if the XAudio2 engine is running other submix voices. The voice is processed after all other voices that include a smaller ProcessingStage value, and before all other voices that include a larger ProcessingStage value. Voices that include the same ProcessingStage value are processed in any order. A submix voice cannot send to another submix voice with a lower or equal ProcessingStage value; this prevents audio being lost due to a submix cycle. No documentation. HRESULT IXAudio2::CreateSubmixVoice([Out] IXAudio2SubmixVoice** ppSubmixVoice,[None] UINT32 InputChannels,[None] UINT32 InputSampleRate,[None] UINT32 Flags,[None] UINT32 ProcessingStage,[In, Optional] const XAUDIO2_VOICE_SENDS* pSendList,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) is the interface for theXAudio2object that manages all audio engine states, the audio processing thread, the voice graph, and so forth. This is the only XAudio2 interface that is derived from the COMinterface. It controls the lifetime of theXAudio2object using two methods derived from:IXAudio2::AddRefandIXAudio2::Release. No other XAudio2 objects are reference-counted. Their lifetimes are explicitly controlled usingcreateanddestroycalls, and are bounded by the lifetime of the XAudio2 object that owns them. microsoft.directx_sdk.ixaudio2.ixaudio2 IXAudio2 IXAudio2 Constant MaximumBufferBytes. XAUDIO2_MAX_BUFFER_BYTES Constant MaximumQueuedBuffers. XAUDIO2_MAX_QUEUED_BUFFERS Constant MaximumAudioChannels. XAUDIO2_MAX_AUDIO_CHANNELS Constant MinimumSampleRate. XAUDIO2_MIN_SAMPLE_RATE Constant MaximumSampleRate. XAUDIO2_MAX_SAMPLE_RATE Constant MaximumVolumeLevel. XAUDIO2_MAX_VOLUME_LEVEL Constant MinimumFrequencyRatio. XAUDIO2_MIN_FREQ_RATIO Constant MaximumFrequencyRatio. XAUDIO2_MAX_FREQ_RATIO Constant DefaultFrequencyRatio. XAUDIO2_DEFAULT_FREQ_RATIO Constant MaximumFilterOneOverQ. XAUDIO2_MAX_FILTER_ONEOVERQ Constant MaximumFilterFrequency. XAUDIO2_MAX_FILTER_FREQUENCY Constant MaximumLoopCount. XAUDIO2_MAX_LOOP_COUNT Constant CommitNow. XAUDIO2_COMMIT_NOW Constant CommitAll. XAUDIO2_COMMIT_ALL Constant NoLoopRegion. XAUDIO2_NO_LOOP_REGION Constant DefaultChannels. XAUDIO2_DEFAULT_CHANNELS Constant DefaultSampleRate. XAUDIO2_DEFAULT_SAMPLERATE Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. Adds anIXAudio2EngineCallbackreference to theXAudio2engine callback list. No documentation.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.

This method can be called multiple times, allowing different components or layers of the same application to manage their own engine callback implementations separately.

It is illegal to call RegisterForCallbacks from within a callback. If RegisterForCallbacks is called within a callback XAUDIO2_E_INVALID_CALL will be returned.

ee418620 HRESULT IXAudio2::RegisterForCallbacks([In] IXAudio2EngineCallback* pCallback) IXAudio2::RegisterForCallbacks
Removes anIXAudio2EngineCallbackreference from theXAudio2engine callback list. No documentation.

It is illegal to call UnregisterForCallbacks from within a callback. If UnregisterForCallbacks is called within a callback XAUDIO2_E_INVALID_CALL will be returned.

ee418630 void IXAudio2::UnregisterForCallbacks([In] IXAudio2EngineCallback* pCallback) IXAudio2::UnregisterForCallbacks
Creates and configures a source voice.
[out] If successful, returns a reference to the new object.
[in] Pointer to a structure. This structure contains the expected format for all audio buffers submitted to the source voice.

XAudio2 supports PCM and ADPCM voice types. XAudio2 supports the following PCM formats.

  • 8-bit (unsigned) integer PCM

  • 16-bit integer PCM (optimal format for XAudio2)

  • 20-bit integer PCM (either in 24 or 32 bit containers)

  • 24-bit integer PCM (either in 24 or 32 bit containers)

  • 32-bit integer PCM

  • 32-bit float PCM (preferred format after 16-bit integer)

The number of channels in a source voice must be less than or equal to . The sample rate of a source voice must be between and .

Note
Data formats such as ADPCM that require more information than provided by have a structure as the first member in their format structures. When you create a source voice with one of those formats, cast the format's structure as a structure and use it as the value for pSourceFormat.
[in] Flags that specify the behavior of the source voice. A flag can be 0 or a combination of one or more of the following:
ValueDescription
No pitch control is available on the voice.?
No sample rate conversion is available on the voice. The voice's outputs must have the same sample rate. Note The flag causes the voice to behave as though the flag also is specified. ?
The filter effect should be available on this voice.?
[in] Highest allowable frequency ratio that can be set on this voice. The value for this argument must be between and . Subsequent calls to are clamped between and MaxFrequencyRatio.

The maximum value for this argument is defined as , which allows pitch to be raised by up to 10 octaves.

If MaxFrequencyRatio is less than 1.0, the voice will use that ratio immediately after being created (rather than the default of 1.0).

Xbox 360

For XMA voices, there is one more restriction on the MaxFrequencyRatio argument and the voice's sample rate. The product of these two numbers cannot exceed XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MONO for one-channel voices or XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MULTICHANNEL for voices with any other number of channels. If the value specified for MaxFrequencyRatio is too high for the specified format, the call to CreateSourceVoice fails and produces a debug message.

Note
You can use the lowest possible MaxFrequencyRatio value to reduce XAudio2's memory usage.
[in, optional] Pointer to a client-provided callback interface, .
[in, optional] Pointer to a list of structures that describe the set of destination voices for the source voice. If pSendList is null, the send list defaults to a single output to the first mastering voice created.
[in, optional] Pointer to a list of structures that describe an effect chain to use in the source voice.

Returns if successful; otherwise, an error code.

See XAudio2 Error Codes for descriptions of XAudio2-specific error codes.

Source voices read audio data from the client. They process the data and send it to the XAudio2 processing graph.

A source voice includes a variable-rate sample rate conversion, to convert data from the source format sample rate to the output rate required for the voice send list. If you use a null send list, the target sample rate will be the mastering voice's input sample rate. If you provide a single voice in pSendList, that voice's input sample rate is the target rate. If you provide multiple voices in the pSendList, all the source voice's output voices must be running at the same input sample rate.

You cannot create any source or submix voices until a mastering voice exists, and you cannot destory a mastering voice if any source or submix voices still exist.

Source voices are always processed before any submix or mastering voices. This means that you do not need a ProcessingStage parameter to control the processing order.

When first created, source voices are in the stopped state.

XAudio2 uses an internal memory pooler for voices with the same format. This means memory allocation for voices will occur less frequently as more voices are created and then destroyed. To minimize just-in-time allocations, a title can create the anticipated maximum number of voices needed up front, and then delete them as necessary. Voices will then be reused from the XAudio2 pool. The memory pool is tied to an XAudio2 engine instance. You can reclaim all the memory used by an instance of the XAudio2 engine by destroying the XAudio2 object and recreating it as necessary (forcing the memory pool to grow via preallocation would have to be reapplied as needed).

It is illegal to call CreateSourceVoice from within a callback. If you call CreateSourceVoice within a callback, XAUDIO2_E_INVALID_CALL is returned.

The that is passed in as the pEffectChain argument and any information contained within it are no longer needed after CreateSourceVoice successfully completes, and may be deleted immediately after CreateSourceVoice is called.

microsoft.directx_sdk.ixaudio2.ixaudio2.createsourcevoice HRESULT IXAudio2::CreateSourceVoice([Out, Fast] IXAudio2SourceVoice** ppSourceVoice,[In] const void* pSourceFormat,[In] XAUDIO2_VOICE_FLAGS Flags,[In] float MaxFrequencyRatio,[In, Optional] IXAudio2VoiceCallback* pCallback,[In, Optional] const XAUDIO2_VOICE_SENDS* pSendList,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) IXAudio2::CreateSourceVoice
Creates and configures a submix voice.
[out] On success, returns a reference to the new object.
[in] Number of channels in the input audio data of the submix voice.

InputChannels must be less than or equal to .

[in] Sample rate of the input audio data of submix voice. This rate must be a multiple of XAUDIO2_QUANTUM_DENOMINATOR. InputSampleRate must be between and .
[in] Flags that specify the behavior of the submix voice. It can be 0 or the following:
ValueDescription
The filter effect should be available on this voice.?
[in] An arbitrary number that specifies when this voice is processed with respect to other submix voices, if the XAudio2 engine is running other submix voices. The voice is processed after all other voices that include a smaller ProcessingStage value and before all other voices that include a larger ProcessingStage value. Voices that include the same ProcessingStage value are processed in any order. A submix voice cannot send to another submix voice with a lower or equal ProcessingStage value. This prevents audio being lost due to a submix cycle.
[in, optional] Pointer to a list of structures that describe the set of destination voices for the submix voice. If pSendList is null, the send list will default to a single output to the first mastering voice created.
[in, optional] Pointer to a list of structures that describe an effect chain to use in the submix voice.

Returns if successful; otherwise, an error code.

See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.

Submix voices receive the output of one or more source or submix voices. They process the output, and then send it to another submix voice or to a mastering voice.

A submix voice performs a sample rate conversion from the input sample rate to the input rate of its output voices in pSendList. If you specify multiple voice sends, they must all have the input same sample rate.

You cannot create any source or submix voices until a mastering voice exists, and you cannot destroy a mastering voice if any source or submix voices still exist.

When first created, submix voices are in the started state.

XAudio2 uses an internal memory pooler for voices with the same format. This means that memory allocation for voices will occur less frequently as more voices are created and then destroyed. To minimize just-in-time allocations, a title can create the anticipated maximum number of voices needed up front, and then delete them as necessary. Voices will then be reused from the XAudio2 pool. The memory pool is tied to an XAudio2 engine instance. You can reclaim all the memory used by an instance of the XAudio2 engine by destroying the XAudio2 object and recreating it as necessary (forcing the memory pool to grow via preallocation would have to be reapplied as needed).

It is illegal to call CreateSubmixVoice from within a callback. If you call CreateSubmixVoice within a callback, XAUDIO2_E_INVALID_CALL is returned.

The that is passed in as the pEffectChain argument and any information contained within it are no longer needed after CreateSubmixVoice successfully completes, and may be deleted immediately after CreateSubmixVoice is called.

microsoft.directx_sdk.ixaudio2.ixaudio2.createsubmixvoice HRESULT IXAudio2::CreateSubmixVoice([Out, Fast] IXAudio2SubmixVoice** ppSubmixVoice,[In] unsigned int InputChannels,[In] unsigned int InputSampleRate,[In] XAUDIO2_VOICE_SEND_FLAGS Flags,[In] unsigned int ProcessingStage,[In, Optional] const XAUDIO2_VOICE_SENDS* pSendList,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain) IXAudio2::CreateSubmixVoice

Creates and configures a mastering voice.

[out] If successful, returns a reference to the new object.
[in] Number of channels the mastering voice expects in its input audio.

InputChannels must be less than or equal to .

InputChannels can be set to , with the default being determined by the current platform.

Windows

Attempts to detect the system speaker configuration setup.

Xbox 360

Defaults to 5.1 surround.

[in] Sample rate of the input audio data of the mastering voice. This rate must be a multiple of XAUDIO2_QUANTUM_DENOMINATOR.

InputSampleRate must be between and .

InputSampleRate can be set to , with the default being determined by the current platform.

Windows

Windows XP defaults to 44100.

Windows Vista and Windows 7 default to the setting specified in the Sound Control Panel. The default for this setting is 44100 (or 48000 if required by the driver).

Xbox 360

Defaults to 48000.

[in] Flags that specify the behavior of the mastering voice. Must be 0.
[in] Index of the output device that will be sent input by the mastering voice. Specifying the default value of 0 causes XAudio2 to select the global default audio device.
[in, optional] Pointer to an structure that describe an effect chain to use in the mastering voice, or null to use no effects.
No documentation.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.

Mastering voices receive the output of one or more source or submix voices. They process the data and send it to the audio output device.

Typically, a mastering voice should be created with an input sample rate that will be used by the majority of the title's audio content. The mastering voice performs a sample rate conversion from this input sample rate to the actual device output rate. Alternatively, IXAudio2::GetDeviceDetails can be used to find the native audio rate, and that can be used throughout the majority of the title's audio graph.

No source or submix voices can be created until a mastering voice exists, and a mastering voice cannot be destroyed if any source or submix voices still exist.

Mastering voices are always processed after all source and submix voices. This means that you need not specify a ProcessingStage parameter to control the processing order.

Several mastering voices can exist at once, but only one of them can be started. Only one device can be used by XAudio2 at a time.

When first created, mastering voices are in the started state.

It is illegal to call CreateMasteringVoice from within a callback. If CreateMasteringVoice is called within a callback XAUDIO2_E_INVALID_CALL will be returned.

ee418605 HRESULT IXAudio2::CreateMasteringVoice([Out, Fast] IXAudio2MasteringVoice** ppMasteringVoice,[In] unsigned int InputChannels,[In] unsigned int InputSampleRate,[In] unsigned int Flags,[In, Optional] const wchar_t* szDeviceId,[In, Optional] const XAUDIO2_EFFECT_CHAIN* pEffectChain,[In] AUDIO_STREAM_CATEGORY StreamCategory) IXAudio2::CreateMasteringVoice
Starts the audio processing thread.

Returns if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.

After StartEngine is called, all started voices begin to consume audio. All enabled effects start running, and the resulting audio is sent to any connected output devices. When XAudio2 is first initialized, the engine is already in the started state.

It is illegal to call StartEngine from within a callback. If StartEngine is called within a callback XAUDIO2_E_INVALID_CALL will be returned.

ee418626 HRESULT IXAudio2::StartEngine() IXAudio2::StartEngine
Stops the audio processing thread.

When StopEngine is called, all output is stopped immediately. However, the audio graph is left untouched, preserving effect parameters, effect histories (for example, the data stored by a reverb effect in order to emit echoes of a previous sound), voice states, pending source buffers, cursor positions, and so forth. When the engine is restarted, the resulting audio output will be identical?apart from a period of silence?to the output that would have been produced if the engine had never been stopped.

It is illegal to call StopEngine from within a callback. If StopEngine is called within a callback XAUDIO2_E_INVALID_CALL will be returned.

microsoft.directx_sdk.ixaudio2.ixaudio2.stopengine void IXAudio2::StopEngine() IXAudio2::StopEngine
Atomically applies a set of operations that are tagged with a given identifier.
[in] Identifier of the set of operations to be applied. To commit all pending operations, pass .

Returns if successful; returns an error code otherwise. See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.

CommitChanges does nothing if no operations are tagged with the given identifier.

See the XAudio2 Operation Sets overview about working with CommitChanges and XAudio2 interface methods that may be deferred.

microsoft.directx_sdk.ixaudio2.ixaudio2.commitchanges HRESULT IXAudio2::CommitChanges([In] unsigned int OperationSet) IXAudio2::CommitChanges
Returns current resource usage details, such as available memory or CPU usage.
[out] On success, reference to an structure that is returned.

For specific information on the statistics returned by GetPerformanceData, see the structure reference.

microsoft.directx_sdk.ixaudio2.ixaudio2.getperformancedata void IXAudio2::GetPerformanceData([Out] XAUDIO2_PERFORMANCE_DATA* pPerfData) IXAudio2::GetPerformanceData
Changes global debug logging options for XAudio2.
Note
This function has no effect in this version of XAudio2.
Pointer to a structure that contains the new debug configuration.
No documentation.

This function only has an effect in debug versions of the XAudio2 library. SetDebugConfiguration sets the debug configuration for all instances of XAudio2 in the current process, not just the one interface on which the call was made.

The default debug level produces only ERROR and WARNING messages. See for other debug levels.

ee418624 void IXAudio2::SetDebugConfiguration([In, Value] const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,[In] void* pReserved) IXAudio2::SetDebugConfiguration
Initializes a new instance of the class. Initializes a new instance of the class. Specify a Debug or Normal XAudio2 instance. The processor specifier. Calculate a decibel from a volume. The volume. a dB value Calculate radians from a cutoffs frequency. The cutoff frequency. The sample rate. radian Calculate a cutoff frequency from a radian. The radians. The sample rate. cutoff frequency Calculate a volume from a decibel a dB value an amplitude value Calculate semitones from a Frequency ratio The frequency ratio. semitones Calculate frequency from semitones. The semitones. the frequency Atomically applies a set of operations for all pending operations. HRESULT IXAudio2::CommitChanges([None] UINT32 OperationSet) Returns current resource usage details, such as available memory or CPU usage.

For specific information on the statistics returned by GetPerformanceData, see the structure reference.

microsoft.directx_sdk.ixaudio2.ixaudio2.getperformancedata GetPerformanceData GetPerformanceData void IXAudio2::GetPerformanceData([Out] XAUDIO2_PERFORMANCE_DATA* pPerfData)
Called by XAudio2 just before an audio processing pass begins. Called by XAudio2 just after an audio processing pass ends. Called if a critical system error occurs that requires XAudio2 to be closed down and restarted. Used withIXAudio2SourceVoice::SubmitSourceBufferwhen submitting xWMA data.

When streaming an xWMA file a few packets at a time, should be specified on the last packet. Alternatively, the application may call after submitting the last packet.

In addition, when streaming an xWMA file a few packets at a time, the application should subtract pDecodedPacketCumulativeBytes[PacketCount-1] of the previous packet from all the entries of the currently submitted packet.

The members of correspond to values contained in the 'dpds' RIFF chunk of the xWMA file being played. PacketCount will correspond to the size in UINT32s of the chunk. pDecodedPacketCumulativeBytes will correspond to a UINT32 buffer containing the contents of the chunk. The contents of the buffer will need to be byte swapped when loading the buffer on Xbox 360.

Memory allocated to hold a or structure can be freed as soon as the call it is passed to returns. The data the structure points to (pAudioData and pDecodedPacketCumulativeBytes, respectively) can't be freed until the buffer completes (as signaled by the callback) or the voice is stopped and destroyed.

ee419229 XAUDIO2_BUFFER_WMA XAUDIO2_BUFFER_WMA
No documentation. const unsigned int* pDecodedPacketCumulativeBytes unsigned int pDecodedPacketCumulativeBytes No documentation. unsigned int PacketCount unsigned int PacketCount Contains the new global debug configuration for XAudio2. Used with theSetDebugConfigurationfunction.

Debugging messages can be completely turned off by initializing to all zeroes.

ee419231 XAUDIO2_DEBUG_CONFIGURATION XAUDIO2_DEBUG_CONFIGURATION
No documentation. unsigned int TraceMask unsigned int TraceMask No documentation. unsigned int BreakMask unsigned int BreakMask No documentation. BOOL LogThreadID BOOL LogThreadID No documentation. BOOL LogFileline BOOL LogFileline No documentation. BOOL LogFunctionName BOOL LogFunctionName No documentation. BOOL LogTiming BOOL LogTiming Defines an effect chain. ee419235 XAUDIO2_EFFECT_CHAIN XAUDIO2_EFFECT_CHAIN
Number of effects in the effect chain for the voice.
ee419235 unsigned int EffectCount unsigned int EffectCount
Array of structures containing references to XAPO instances.
ee419235 XAUDIO2_EFFECT_DESCRIPTOR* pEffectDescriptors XAUDIO2_EFFECT_DESCRIPTOR pEffectDescriptors
Defines filter parameters for a source voice.

Setting with the following values is acoustically equivalent to the filter being fully bypassed.

  FilterParams; FilterParams.Frequency = 1.0f;     FilterParams.OneOverQ = 1.0f; FilterParams.Type = LowPassFilter; 

The following formulas show the relationship between the members of and the per-voice filter.

 Yl( n ) = F1 yb( n ) + yl( n - 1 )	
            Yb( n ) = F1 yh( n ) + yb( n - 1 )	
            Yh( n ) = x( n ) - yl( n ) - OneOverQ(yb( n - 1 )	
            Yn( n ) = Yl(n) + Yh(n)	
            

Where:

 Yl = lowpass output	
            Yb = bandpass output	
            Yh = highpass output	
            Yn = notch output	
            F1 = .Frequency	
            OneOverQ = .OneOverQ	
            
ee419237 XAUDIO2_FILTER_PARAMETERS XAUDIO2_FILTER_PARAMETERS
An indicating whether the filter is low pass, band pass, high pass, or notch.
ee419237 XAUDIO2_FILTER_TYPE Type XAUDIO2_FILTER_TYPE Type
Filter radian frequency calculated as (2 * sin(pi * (desired filter cutoff frequency) / sampleRate)). The frequency must be greater than or equal to 0 and less than or equal to . The maximum frequency allowable is equal to the source sound's sample rate divided by six which corresponds to the maximum filter radian frequency of 1. For example, if a sound's sample rate is 48000 and the desired cutoff frequency is the maximum allowable value for that sample rate, 8000, the value for Frequency will be 1.

If XAUDIO2_HELPER_FUNCTIONS is defined, XAudio2.h will include the XAudio2RadiansToCutoffFrequency and XAudio2CutoffFrequencyToRadians helper functions for converting between hertz and radian frequencies.

ee419237 float Frequency float Frequency
Reciprocal of Q factor. Controls how quickly frequencies beyond Frequency are dampened. Larger values result in quicker dampening while smaller values cause dampening to occur more gradually. Must be greater than 0 and less than or equal to .
ee419237 float OneOverQ float OneOverQ
Contains performance information.

CPU cycles are recorded using . Use to convert these values.

microsoft.directx_sdk.xaudio2.xaudio2_performance_data XAUDIO2_PERFORMANCE_DATA XAUDIO2_PERFORMANCE_DATA
CPU cycles spent on audio processing since the last call to the or function.
microsoft.directx_sdk.xaudio2.xaudio2_performance_data unsigned longlong AudioCyclesSinceLastQuery unsigned longlong AudioCyclesSinceLastQuery
Total CPU cycles elapsed since the last call.
Note
This only counts cycles on the CPU on which XAudio2 is running.
microsoft.directx_sdk.xaudio2.xaudio2_performance_data unsigned longlong TotalCyclesSinceLastQuery unsigned longlong TotalCyclesSinceLastQuery
Fewest CPU cycles spent on processing any single audio quantum since the last call.
microsoft.directx_sdk.xaudio2.xaudio2_performance_data unsigned int MinimumCyclesPerQuantum unsigned int MinimumCyclesPerQuantum
Most CPU cycles spent on processing any single audio quantum since the last call.
microsoft.directx_sdk.xaudio2.xaudio2_performance_data unsigned int MaximumCyclesPerQuantum unsigned int MaximumCyclesPerQuantum
Total memory currently in use.
microsoft.directx_sdk.xaudio2.xaudio2_performance_data unsigned int MemoryUsageInBytes unsigned int MemoryUsageInBytes
Minimum delay that occurs between the time a sample is read from a source buffer and the time it reaches the speakers.
Windows

The delay reported is a variable value equal to the rough distance between the last sample submitted to the driver by XAudio2 and the sample currently playing. The following factors can affect the delay: playing multichannel audio on a hardware-accelerated device; the type of audio device (WavePci, WaveCyclic, or WaveRT); and, to a lesser extent, audio hardware implementation.

Xbox 360

The delay reported is a fixed value, which is normally 1,024 samples (21.333 ms at 48 kHz). If XOverrideSpeakerConfig has been called using the XAUDIOSPEAKERCONFIG_LOW_LATENCY flag, the delay reported is 512 samples (10.667 ms at 48 kHz).

microsoft.directx_sdk.xaudio2.xaudio2_performance_data unsigned int CurrentLatencyInSamples unsigned int CurrentLatencyInSamples
Total audio dropouts since the engine started.
microsoft.directx_sdk.xaudio2.xaudio2_performance_data unsigned int GlitchesSinceEngineStarted unsigned int GlitchesSinceEngineStarted
Number of source voices currently playing.
microsoft.directx_sdk.xaudio2.xaudio2_performance_data unsigned int ActiveSourceVoiceCount unsigned int ActiveSourceVoiceCount
Total number of source voices currently in existence.
microsoft.directx_sdk.xaudio2.xaudio2_performance_data unsigned int TotalSourceVoiceCount unsigned int TotalSourceVoiceCount
Number of submix voices currently playing.
microsoft.directx_sdk.xaudio2.xaudio2_performance_data unsigned int ActiveSubmixVoiceCount unsigned int ActiveSubmixVoiceCount
Number of resampler xAPOs currently active.
microsoft.directx_sdk.xaudio2.xaudio2_performance_data unsigned int ActiveResamplerCount unsigned int ActiveResamplerCount
Number of matrix mix xAPOs currently active.
microsoft.directx_sdk.xaudio2.xaudio2_performance_data unsigned int ActiveMatrixMixCount unsigned int ActiveMatrixMixCount
Windows

Unsupported.

Xbox 360

Number of source voices decoding XMA data.

microsoft.directx_sdk.xaudio2.xaudio2_performance_data unsigned int ActiveXmaSourceVoices unsigned int ActiveXmaSourceVoices
Windows

Unsupported.

Xbox 360

A voice can use more than one XMA stream.

microsoft.directx_sdk.xaudio2.xaudio2_performance_data unsigned int ActiveXmaStreams unsigned int ActiveXmaStreams
Contains information about the creation flags, input channels, and sample rate of a voice. microsoft.directx_sdk.xaudio2.xaudio2_voice_details XAUDIO2_VOICE_DETAILS XAUDIO2_VOICE_DETAILS
Flags used to create the voice; see the individual voice interfaces for more information.
microsoft.directx_sdk.xaudio2.xaudio2_voice_details XAUDIO2_VOICE_FLAGS CreationFlags XAUDIO2_VOICE_FLAGS CreationFlags
Flags that are currently set on the voice.
microsoft.directx_sdk.xaudio2.xaudio2_voice_details unsigned int ActiveFlags unsigned int ActiveFlags
The number of input channels the voice expects.
microsoft.directx_sdk.xaudio2.xaudio2_voice_details unsigned int InputChannels unsigned int InputChannels
The input sample rate the voice expects.
microsoft.directx_sdk.xaudio2.xaudio2_voice_details unsigned int InputSampleRate unsigned int InputSampleRate
Defines a destination voice that is the target of a send from another voice and specifies whether a filter should be used. ee419244 XAUDIO2_SEND_DESCRIPTOR XAUDIO2_SEND_DESCRIPTOR
Indicates whether a filter should be used on data sent to the voice pointed to by pOutputVoice. Flags can be 0 or XAUDIO2_SEND_USEFILTER.
ee419244 XAUDIO2_VOICE_SEND_FLAGS Flags XAUDIO2_VOICE_SEND_FLAGS Flags
A reference to an that will be the target of the send. The pOutputVoice member cannot be null.
ee419244 IXAudio2Voice* pOutputVoice IXAudio2Voice pOutputVoice
Initializes a new instance of the struct. The output voice. Initializes a new instance of the struct. The send flags. The output voice. Gets or sets the output voice. This parameter cannot be null. The output voice. Defines a set of voices to receive data from a single output voice.

If pSends is not null all of its elements must be non-null. To send output to the default mastering voice call with the pSendList argument set to null.

Setting SendCount to 0 is useful for certain effects such as volume meters or file writers that don't generate any audio output to pass on to another voice.

If needed, a voice will perform a single sample rate conversion, from the voice's input sample rate to the input sample rate of the voice's output voices. Because only one sample rate conversion will be performed, all the voice's output voices must have the same input sample rate. If the input sample rates of the voice and its output voices are the same, no sample rate conversion is performed.

ee419246 XAUDIO2_VOICE_SENDS XAUDIO2_VOICE_SENDS
Number of voices to receive the output of the voice. An OutputCount value of 0 indicates the voice should not send output to any voices.
ee419246 unsigned int SendCount unsigned int SendCount
Array of structures describing destination voices and the filters that should be used when sending to the voices. This array should contain SendCount elements. If SendCount is 0 pSends should be null. Note that pSends cannot contain the same voice more than once.
ee419246 XAUDIO2_SEND_DESCRIPTOR* pSends XAUDIO2_SEND_DESCRIPTOR pSends
Returns the voice's current state and cursor position data.

For all encoded formats, including constant bit rate (CBR) formats such as adaptive differential pulse code modulation (ADPCM), SamplesPlayed is expressed in terms of decoded samples. For pulse code modulation (PCM) formats, SamplesPlayed is expressed in terms of either input or output samples. There is a one-to-one mapping from input to output for PCM formats.

If a client needs to get the correlated positions of several voices?that is, to know exactly which sample of a particular voice is playing when a specified sample of another voice is playing?it must make the calls in an XAudio2 engine callback. Doing this ensures that none of the voices advance while the calls are made.

ee419247 XAUDIO2_VOICE_STATE XAUDIO2_VOICE_STATE
Pointer to a buffer context provided in the that is processed currently, or, if the voice is stopped currently, to the next buffer due to be processed. pCurrentBufferContext is null if there are no buffers in the queue.
ee419247 void* pCurrentBufferContext void pCurrentBufferContext
Number of audio buffers currently queued on the voice, including the one that is processed currently.
ee419247 unsigned int BuffersQueued unsigned int BuffersQueued
Total number of samples processed by this voice since it last started, or since the last audio stream ended (as marked with the flag). This total includes samples played multiple times due to looping. Theoretically, if all audio emitted by the voice up to this time is captured, this parameter would be the length of the audio stream in samples. If you specify when you call , this member won't be calculated, and its value is unspecified on return from . takes about one-third as much time to complete when you specify .
ee419247 unsigned longlong SamplesPlayed unsigned longlong SamplesPlayed
No documentation. X3DAudioCalculateFlags X3DAudioCalculateFlags No documentation. X3DAUDIO_CALCULATE_MATRIX X3DAUDIO_CALCULATE_MATRIX No documentation. X3DAUDIO_CALCULATE_DELAY X3DAUDIO_CALCULATE_DELAY No documentation. X3DAUDIO_CALCULATE_LPF_DIRECT X3DAUDIO_CALCULATE_LPF_DIRECT No documentation. X3DAUDIO_CALCULATE_LPF_REVERB X3DAUDIO_CALCULATE_LPF_REVERB No documentation. X3DAUDIO_CALCULATE_REVERB X3DAUDIO_CALCULATE_REVERB No documentation. X3DAUDIO_CALCULATE_DOPPLER X3DAUDIO_CALCULATE_DOPPLER No documentation. X3DAUDIO_CALCULATE_EMITTER_ANGLE X3DAUDIO_CALCULATE_EMITTER_ANGLE No documentation. X3DAUDIO_CALCULATE_ZEROCENTER X3DAUDIO_CALCULATE_ZEROCENTER No documentation. X3DAUDIO_CALCULATE_REDIRECT_TO_LFE X3DAUDIO_CALCULATE_REDIRECT_TO_LFE Functions Speed of sound in the air. Sets all global 3D audio constants.
[in] Assignment of channels to speaker positions. This value must not be zero. The only permissible value on Xbox 360 is SPEAKER_XBOX.
[in] Speed of sound, in user-defined world units per second. Use this value only for doppler calculations. It must be greater than or equal to FLT_MIN.
[out] 3D audio instance handle. Use this handle when you call .
None. microsoft.directx_sdk.x3daudio.x3daudioinitialize HRESULT X3DAudioInitialize([In] SPEAKER_FLAGS SpeakerChannelMask,[In] float SpeedOfSound,[Out] X3DAUDIOHANDLE* Instance) X3DAudioInitialize
Calculates DSP settings with respect to 3D parameters.
[in] 3D audio instance handle. Call to get this handle.
[in] Pointer to an representing the point of reception.
[in] Pointer to an representing the sound source.
[in] Flags used to control which DSP settings are calculated:
ValueDescription
Enables matrix coefficient table calculation.?
Enables delay time array calculation (stereo only).?
Enables low pass filter (LPF) direct-path coefficient calculation.?
Enables LPF reverb-path coefficient calculation.?
Enables reverb send level calculation.?
Enables Doppler shift factor calculation.?
Enables emitter-to-listener interior angle calculation.?
Fills the center channel with silence. This flag allows you to keep a 6-channel matrix so you do not have to remap the channels, but the center channel will be silent. This flag is only valid if you also set .?
Applies an equal mix of all source channels to a low frequency effect (LFE) destination channel. It only applies to matrix calculations with a source that does not have an LFE channel and a destination that does have an LFE channel. This flag is only valid if you also set .?
[in, out] Pointer to an structure that receives the calculation results.
ee419052 void X3DAudioCalculate([In] const X3DAUDIOHANDLE* Instance,[In] const X3DAUDIO_LISTENER* pListener,[In] const X3DAUDIO_EMITTER* pEmitter,[In] X3DAudioCalculateFlags Flags,[InOut] X3DAUDIO_DSP_SETTINGS* pDSPSettings) X3DAudioCalculate
Initializes a new instance of the class. The speakers config. Initializes a new instance of the class. The speakers config. The speed of sound. Calculates dsp settings for the specified listener and emitter. The listener. The emitter. The flags. The source channel count. The destination channel count. Dsp settings Specifies directionality for a single-channel non-LFE emitter by scaling DSP behavior with respect to the emitter's orientation.

For a detailed explanation of sound cones see Sound Cones.

ee419054 X3DAUDIO_CONE X3DAUDIO_CONE
Inner cone angle in radians. This value must be within 0.0f to X3DAUDIO_2PI.
ee419054 float InnerAngle float InnerAngle
Outer cone angle in radians. This value must be within InnerAngle to X3DAUDIO_2PI.
ee419054 float OuterAngle float OuterAngle
Volume scaler on/within inner cone. This value must be within 0.0f to 2.0f.
ee419054 float InnerVolume float InnerVolume
Volume scaler on/beyond outer cone. This value must be within 0.0f to 2.0f.
ee419054 float OuterVolume float OuterVolume
LPF direct-path or reverb-path coefficient scaler on/within inner cone. This value is only used for LPF calculations and must be within 0.0f to 1.0f.
ee419054 float InnerLPF float InnerLPF
LPF direct-path or reverb-path coefficient scaler on or beyond outer cone. This value is only used for LPF calculations and must be within 0.0f to 1.0f.
ee419054 float OuterLPF float OuterLPF
Reverb send level scaler on or within inner cone. This must be within 0.0f to 2.0f.
ee419054 float InnerReverb float InnerReverb
Reverb send level scaler on/beyond outer cone. This must be within 0.0f to 2.0f.
ee419054 float OuterReverb float OuterReverb
Defines a DSP setting at a given normalized distance. ee419056 X3DAUDIO_DISTANCE_CURVE_POINT X3DAUDIO_DISTANCE_CURVE_POINT
Normalized distance. This must be within 0.0f to 1.0f.
ee419056 float Distance float Distance
DSP control setting.
ee419056 float DSPSetting float DSPSetting
Defines a DSP setting at a given normalized distance. ee419056 X3DAUDIO_DISTANCE_CURVE X3DAUDIO_DISTANCE_CURVE
Normalized distance. This must be within 0.0f to 1.0f.
ee419056 X3DAUDIO_DISTANCE_CURVE_POINT* pPoints X3DAUDIO_DISTANCE_CURVE_POINT pPoints
DSP control setting.
ee419056 unsigned int PointCount unsigned int PointCount
Receives the results from a call toX3DAudioCalculate.

The following members must be initialized before passing this structure to the function:

  • pMatrixCoefficients

  • pDelayTimes

  • SrcChannelCount

  • DstChannelCount

The following members are returned by passing this structure to the function:

  • pMatrixCoefficients

  • pDelayTimes

  • LPFDirectCoefficient

  • LPFReverbCoefficient

  • ReverbLevel

  • DopplerFactor

  • EmitterToListenerAngle

  • EmitterToListenerDistance

  • EmitterVelocityComponent

  • ListenerVelocityComponent

Note
For pMatrixCoefficients and pDelayTimes, does not allocate additional memory. merely modifies the values at the memory locations allocated for these references.
ee419057 X3DAUDIO_DSP_SETTINGS X3DAUDIO_DSP_SETTINGS No documentation. X3DAUDIO_DSP_SETTINGS
No documentation. float* pMatrixCoefficients float pMatrixCoefficients No documentation. float* pDelayTimes float pDelayTimes No documentation. unsigned int SrcChannelCount unsigned int SrcChannelCount No documentation. unsigned int DstChannelCount unsigned int DstChannelCount No documentation. float LPFDirectCoefficient float LPFDirectCoefficient No documentation. float LPFReverbCoefficient float LPFReverbCoefficient No documentation. float ReverbLevel float ReverbLevel No documentation. float DopplerFactor float DopplerFactor No documentation. float EmitterToListenerAngle float EmitterToListenerAngle No documentation. float EmitterToListenerDistance float EmitterToListenerDistance No documentation. float EmitterVelocityComponent float EmitterVelocityComponent No documentation. float ListenerVelocityComponent float ListenerVelocityComponent Defines a single-point or multiple-point 3D audio source that is used with an arbitrary number of sound channels.

only supports a cone in a single-point emitter. Multi-point emitters are a convenient and efficient way to manage a related group of sound sources. Many properties are shared among all channel points, such as Doppler?the same Doppler shift is applied to all channels in the emitter. Thus, the Doppler value need only be calculated once, not per-point as would be needed with multiple separate single-point emitters. Because only has one orientation vector, a multi-point emitter cone would be of limited usefulness, forcing all channels to behave as if they were facing the same direction. If multiple independent cones are needed, multiple single-point emitters should be used, each with its own orientation.

The parameter type is typed to DirectX::XMFLOAT3, to provide x , y , and z floating-point values.

X3DAudio uses a left-handed Cartesian coordinate system, with values on the x-axis increasing from left to right, on the y-axis from bottom to top, and on the z-axis from near to far. Azimuths are measured clockwise from a given reference direction.

For user-defined distance curves, the distance field of the first point must be 0.0f and the distance field of the last point must be 1.0f.

If an emitter moves beyond a distance of (CurveDistanceScaler ? 1.0f), the last point on the curve is used to compute the volume output level. The last point is determined by the following:

.pPoints[PointCount-1].DSPSetting)
Inner Radius and Inner Radius Angle

InnerRadius is used to specify an area of smooth transition around the origin point as a sound travels directly through, above or below the listener. Elevation is accounted for by specifying an InnerRadiusAngle, whereby a sound whose elevation increases or decreases, will eventually start to bleed the sound into more than just two speakers.

When Inner Radius and Inner Radius Angle are not used, emitters are audible in the two closest speakers to their current position/orientation (or, if directly on a line with one speaker's defined angle, solely from that one speaker).

Inner Radius and Inner Radius Angle have no effect on emitters positioned outside of the cones they describe. Inside of the cone, they will gradually cause the sound to bleed into the opposite speakers, until the sound will be equally heard in all speakers when the emitter is at the same position as (or directly above or below) the listener.

microsoft.directx_sdk.x3daudio.x3daudio_emitter X3DAUDIO_EMITTER X3DAUDIO_EMITTER No documentation. X3DAUDIO_EMITTER
Pointer to a sound cone. Used only with single-channel emitters for matrix, LPF (both direct and reverb paths), and reverb calculations. null specifies the emitter is omnidirectional.
microsoft.directx_sdk.x3daudio.x3daudio_emitter X3DAUDIO_CONE* pCone X3DAUDIO_CONE pCone
Orientation of the front direction. This value must be orthonormal with OrientTop. OrientFront must be normalized when used. For single-channel emitters without cones OrientFront is only used for emitter angle calculations. For multi channel emitters or single-channel with cones OrientFront is used for matrix, LPF (both direct and reverb paths), and reverb calculations.
microsoft.directx_sdk.x3daudio.x3daudio_emitter X3DAUDIO_VECTOR OrientFront X3DAUDIO_VECTOR OrientFront
Orientation of the top direction. This value must be orthonormal with OrientFront. OrientTop is only used with multi-channel emitters for matrix calculations.
microsoft.directx_sdk.x3daudio.x3daudio_emitter X3DAUDIO_VECTOR OrientTop X3DAUDIO_VECTOR OrientTop
Position in user-defined world units. This value does not affect Velocity.
microsoft.directx_sdk.x3daudio.x3daudio_emitter X3DAUDIO_VECTOR Position X3DAUDIO_VECTOR Position
Velocity vector in user-defined world units/second. This value is used only for doppler calculations. It does not affect Position.
microsoft.directx_sdk.x3daudio.x3daudio_emitter X3DAUDIO_VECTOR Velocity X3DAUDIO_VECTOR Velocity
Value to be used for the inner radius calculations. If InnerRadius is 0, then no inner radius is used, but InnerRadiusAngle may still be used. This value must be between 0.0f and MAX_FLT.
microsoft.directx_sdk.x3daudio.x3daudio_emitter float InnerRadius float InnerRadius
Value to be used for the inner radius angle calculations. This value must be between 0.0f and X3DAUDIO_PI/4.0.
microsoft.directx_sdk.x3daudio.x3daudio_emitter float InnerRadiusAngle float InnerRadiusAngle
Number of emitters defined by the structure. Must be greater than 0.
microsoft.directx_sdk.x3daudio.x3daudio_emitter unsigned int ChannelCount unsigned int ChannelCount
Distance from Position that channels will be placed if ChannelCount is greater than 1. ChannelRadius is only used with multi-channel emitters for matrix calculations. Must be greater than or equal to 0.0f.
microsoft.directx_sdk.x3daudio.x3daudio_emitter float ChannelRadius float ChannelRadius
Table of channel positions, expressed as an azimuth in radians along the channel radius with respect to the front orientation vector in the plane orthogonal to the top orientation vector. An azimuth of X3DAUDIO_2PI specifies a channel is a low-frequency effects (LFE) channel. LFE channels are positioned at the emitter base and are calculated with respect to pLFECurve only, never pVolumeCurve. pChannelAzimuths must have at least ChannelCount elements. The table values must be within 0.0f to X3DAUDIO_2PI. pChannelAzimuths is used with multi-channel emitters for matrix calculations.
microsoft.directx_sdk.x3daudio.x3daudio_emitter float* pChannelAzimuths float pChannelAzimuths
Volume-level distance curve, which is used only for matrix calculations. null specifies a specialized default curve that conforms to the inverse square law, such that when distance is between 0.0f and CurveDistanceScaler ? 1.0f, no attenuation is applied.

When distance is greater than CurveDistanceScaler ? 1.0f, the amplification factor is (CurveDistanceScaler ? 1.0f)/distance. At a distance of CurveDistanceScaler ? 2.0f, the sound will be at half volume or -6 dB, at a distance of CurveDistanceScaler ? 4.0f, the sound will be at one quarter volume or -12 dB, and so on.

pVolumeCurve and pLFECurve are independent of each other. pVolumeCurve does not affect LFE channel volume.

microsoft.directx_sdk.x3daudio.x3daudio_emitter X3DAUDIO_DISTANCE_CURVE* pVolumeCurve X3DAUDIO_DISTANCE_CURVE pVolumeCurve
LFE roll-off distance curve, or null to use default curve: [0.0f, CurveDistanceScaler ?1.0f], [CurveDistanceScaler ?1.0f, 0.0f]. A null value for pLFECurve specifies a default curve that conforms to the inverse square law with distances <= CurveDistanceScaler clamped to no attenuation.

pVolumeCurve and pLFECurve are independent of each other. pLFECurve does not affect non LFE channel volume.

microsoft.directx_sdk.x3daudio.x3daudio_emitter X3DAUDIO_DISTANCE_CURVE* pLFECurve X3DAUDIO_DISTANCE_CURVE pLFECurve
Low-pass filter (LPF) direct-path coefficient distance curve, or null to use the default curve: [0.0f, 1.0f], [1.0f, 0.75f]. pLPFDirectCurve is only used for LPF direct-path calculations.
microsoft.directx_sdk.x3daudio.x3daudio_emitter X3DAUDIO_DISTANCE_CURVE* pLPFDirectCurve X3DAUDIO_DISTANCE_CURVE pLPFDirectCurve
LPF reverb-path coefficient distance curve, or null to use default curve: [0.0f, 0.75f], [1.0f, 0.75f]. pLPFReverbCurve is only used for LPF reverb path calculations.
microsoft.directx_sdk.x3daudio.x3daudio_emitter X3DAUDIO_DISTANCE_CURVE* pLPFReverbCurve X3DAUDIO_DISTANCE_CURVE pLPFReverbCurve
Reverb send level distance curve, or null to use default curve: [0.0f, 1.0f], [1.0f, 0.0f].
microsoft.directx_sdk.x3daudio.x3daudio_emitter X3DAUDIO_DISTANCE_CURVE* pReverbCurve X3DAUDIO_DISTANCE_CURVE pReverbCurve
Curve distance scaler that is used to scale normalized distance curves to user-defined world units, and/or to exaggerate their effect. This does not affect any other calculations. The value must be within the range FLT_MIN to FLT_MAX. CurveDistanceScaler is only used for matrix, LPF (both direct and reverb paths), and reverb calculations.
microsoft.directx_sdk.x3daudio.x3daudio_emitter float CurveDistanceScaler float CurveDistanceScaler
Doppler shift scaler that is used to exaggerate Doppler shift effect. DopplerScaler is only used for Doppler calculations and does not affect any other calculations. The value must be within the range 0.0f to FLT_MAX.
microsoft.directx_sdk.x3daudio.x3daudio_emitter float DopplerScaler float DopplerScaler
Reference to Cone data. X3DAUDIO_CONE* pCone disabled as it is not used Defines a point of 3D audio reception.

The parameter type is typed to DirectX::XMFLOAT3, to provide x, y and z floating-point values.

A listener's front and top vectors must be orthonormal. To be considered orthonormal, a pair of vectors must have a magnitude of 1 +- 1x10-5 and a dot product of 0 +- 1x10-5.

microsoft.directx_sdk.x3daudio.x3daudio_listener X3DAUDIO_LISTENER X3DAUDIO_LISTENER No documentation. X3DAUDIO_LISTENER
Orientation of front direction. When pCone is null OrientFront is used only for matrix and delay calculations. When pCone is not null OrientFront is used for matrix, LPF (both direct and reverb paths), and reverb calculations. This value must be orthonormal with OrientTop when used.
microsoft.directx_sdk.x3daudio.x3daudio_listener X3DAUDIO_VECTOR OrientFront X3DAUDIO_VECTOR OrientFront
Orientation of top direction, used only for matrix and delay calculations. This value must be orthonormal with OrientFront when used
microsoft.directx_sdk.x3daudio.x3daudio_listener X3DAUDIO_VECTOR OrientTop X3DAUDIO_VECTOR OrientTop
Position in user-defined world units. This value does not affect Velocity.
microsoft.directx_sdk.x3daudio.x3daudio_listener X3DAUDIO_VECTOR Position X3DAUDIO_VECTOR Position
Velocity vector in user-defined world units per second, used only for doppler calculations. This value does not affect Position.
microsoft.directx_sdk.x3daudio.x3daudio_listener X3DAUDIO_VECTOR Velocity X3DAUDIO_VECTOR Velocity
Pointer to an structure for this listener. Providing a listener cone will specify that additional calculations are performed when determining the volume and filter DSP parameters for individual sound sources. A null pCone value specifies an omnidirectional sound and no cone processing is applied. pCone is only used for matrix, LPF (both direct and reverb paths), and reverb calculations.
microsoft.directx_sdk.x3daudio.x3daudio_listener X3DAUDIO_CONE* pCone X3DAUDIO_CONE pCone
Reference to Cone data. X3DAUDIO_CONE* pCone Disabled as it is not used Describes the contents of a stream buffer.

This metadata can be used to implement optimizations that require knowledge of a stream buffer's contents. For example, XAPOs that always produce silent output from silent input can check the flag on the input stream buffer to determine if any signal processing is necessary. If silent, the XAPO can simply set the flag on the output stream buffer to silent and return, thus averting the work of processing silent data.

Likewise, XAPOs that receive valid input data, but generate silence (for any reason), may set the output stream buffer's flag accordingly, rather than writing silent samples to the buffer.

These flags represent what should be assumed is in the respective buffer. The flags may not reflect what is actually stored in memory. For example, the indicates that silent data should be assumed, however the respective memory may be uninitialized

ee419207 XAPO_BUFFER_FLAGS XAPO_BUFFER_FLAGS
No documentation. XAPO_BUFFER_SILENT XAPO_BUFFER_SILENT No documentation. XAPO_BUFFER_VALID XAPO_BUFFER_VALID None. None None No documentation. XAPO_PROPERTY_TYPE XAPO_PROPERTY_TYPE No documentation. XAPO_FLAG_CHANNELS_MUST_MATCH XAPO_FLAG_CHANNELS_MUST_MATCH No documentation. XAPO_FLAG_FRAMERATE_MUST_MATCH XAPO_FLAG_FRAMERATE_MUST_MATCH No documentation. XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH No documentation. XAPO_FLAG_BUFFERCOUNT_MUST_MATCH XAPO_FLAG_BUFFERCOUNT_MUST_MATCH No documentation. XAPO_FLAG_INPLACE_REQUIRED XAPO_FLAG_INPLACE_REQUIRED No documentation. XAPO_FLAG_INPLACE_SUPPORTED XAPO_FLAG_INPLACE_SUPPORTED No documentation. XAPO_FLAG_DEFAULT XAPO_FLAG_DEFAULT Functions Creates an instance of the requested XAPOFX effect.
ID of the effect to create. Use the __uuidof on the effect class name to get the CLSID for an effect. For example, __uuidof(FXReverb) would provide the CLSID for the FXReverb effect. For a list of effects provided by XAPOFX, see XAPOFX Overview. For an example of retrieving the CLSID for an effect, see How to: Use XAPOFX in XAudio2.
Receives a reference to the created XAPO instance. If CreateFX fails, pEffect is untouched.
[optional] Effect-specific initialization parameters. This may be null if InitDataByteSize is zero.
[optional] Size of pInitData in bytes. This may be zero if pInitData is null.
Returns if successful; otherwise, an error code.

The created XAPO will have a reference count of 1. Client code should call IUnknown::Release after passing the XAPO to XAudio2 to allow XAudio2 to dispose of the XAPO when it is no longer needed. Use or to pass an XAPO to XAudio2.

hh405044 HRESULT CreateFX([In] const GUID& clsid,[Out, Fast] IUnknown** pEffect,[In, Buffer, Optional] const void* pInitData,[In] unsigned int InitDataByteSize) CreateFX
No documentation. FXECHO_INITDATA FXECHO_INITDATA No documentation. float MaxDelay float MaxDelay Parameters for use with the FXEcho XAPO.

Echo only supports FLOAT32 audio formats.

ee417667 FXECHO_PARAMETERS FXECHO_PARAMETERS
Ratio of wet (processed) signal to dry (original) signal.
ee417667 float WetDryMix float WetDryMix
Amount of output to feed back into input.
ee417667 float Feedback float Feedback
Delay to all channels in milliseconds. This value must be between FXECHO_MIN_DELAY and .MaxDelay.
ee417667 float Delay float Delay
Parameters for use with the FXEQ XAPO.

Each band ranges from FrequencyCenterN - (BandwidthN / 2) to FrequencyCenterN + (BandwidthN / 2).

microsoft.directx_sdk.xapofx.fxeq_parameters FXEQ_PARAMETERS FXEQ_PARAMETERS
Center frequency in Hz for band 0. Must be between FXEQ_MIN_FREQUENCY_CENTER and FXEQ_MAX_FREQUENCY_CENTER.
microsoft.directx_sdk.xapofx.fxeq_parameters float FrequencyCenter0 float FrequencyCenter0
The boost or decrease to frequencies in band 0. Must be between FXEQ_MIN_GAIN and FXEQ_MAX_GAIN
microsoft.directx_sdk.xapofx.fxeq_parameters float Gain0 float Gain0
Width of band 0. Must be between FXEQ_MIN_BANDWIDTH and FXEQ_MAX_BANDWIDTH.
microsoft.directx_sdk.xapofx.fxeq_parameters float Bandwidth0 float Bandwidth0
Center frequency in Hz for band 1. Must be between FXEQ_MIN_FREQUENCY_CENTER and FXEQ_MAX_FREQUENCY_CENTER.
microsoft.directx_sdk.xapofx.fxeq_parameters float FrequencyCenter1 float FrequencyCenter1
The boost or decrease to frequencies in band 1. Must be between FXEQ_MIN_GAIN and FXEQ_MAX_GAIN
microsoft.directx_sdk.xapofx.fxeq_parameters float Gain1 float Gain1
Width of band 1. Must be between FXEQ_MIN_BANDWIDTH and FXEQ_MAX_BANDWIDTH.
microsoft.directx_sdk.xapofx.fxeq_parameters float Bandwidth1 float Bandwidth1
Center frequency in Hz for band 2. Must be between FXEQ_MIN_FREQUENCY_CENTER and FXEQ_MAX_FREQUENCY_CENTER.
microsoft.directx_sdk.xapofx.fxeq_parameters float FrequencyCenter2 float FrequencyCenter2
The boost or decrease to frequencies in band 2. Must be between FXEQ_MIN_GAIN and FXEQ_MAX_GAIN
microsoft.directx_sdk.xapofx.fxeq_parameters float Gain2 float Gain2
Width of band 2. Must be between FXEQ_MIN_BANDWIDTH and FXEQ_MAX_BANDWIDTH.
microsoft.directx_sdk.xapofx.fxeq_parameters float Bandwidth2 float Bandwidth2
Center frequency in Hz for band 3. Must be between FXEQ_MIN_FREQUENCY_CENTER and FXEQ_MAX_FREQUENCY_CENTER.
microsoft.directx_sdk.xapofx.fxeq_parameters float FrequencyCenter3 float FrequencyCenter3
The boost or decrease to frequencies in band 3. Must be between FXEQ_MIN_GAIN and FXEQ_MAX_GAIN
microsoft.directx_sdk.xapofx.fxeq_parameters float Gain3 float Gain3
Width of band 3. Must be between FXEQ_MIN_BANDWIDTH and FXEQ_MAX_BANDWIDTH.
microsoft.directx_sdk.xapofx.fxeq_parameters float Bandwidth3 float Bandwidth3
Parameters for use with the FXMasteringLimiter XAPO. microsoft.directx_sdk.xapofx.fxmasteringlimiter_parameters FXMASTERINGLIMITER_PARAMETERS FXMASTERINGLIMITER_PARAMETERS Constant DefaultRelease. FXMASTERINGLIMITER_DEFAULT_RELEASE Constant MaximumRelease. FXMASTERINGLIMITER_MAX_RELEASE Constant MinimumLoudness. FXMASTERINGLIMITER_MIN_LOUDNESS Constant DefaultLoudness. FXMASTERINGLIMITER_DEFAULT_LOUDNESS Constant MaximumLoudness. FXMASTERINGLIMITER_MAX_LOUDNESS Constant MinimumRelease. FXMASTERINGLIMITER_MIN_RELEASE
Speed at which the limiter stops affecting audio once it drops below the limiter's threshold. Value must be between and .
microsoft.directx_sdk.xapofx.fxmasteringlimiter_parameters unsigned int Release unsigned int Release
Threshold of the limiter. Value must be between and .
microsoft.directx_sdk.xapofx.fxmasteringlimiter_parameters unsigned int Loudness unsigned int Loudness
Parameters for use with the FXReverb XAPO. microsoft.directx_sdk.xapofx.fxreverb_parameters FXREVERB_PARAMETERS FXREVERB_PARAMETERS
Controls the character of the individual wall reflections. Set to minimum value to simulate a hard flat surface and to maximum value to simulate a diffuse surface.Value must be between FXREVERB_MIN_DIFFUSION and FXREVERB_MAX_DIFFUSION.
microsoft.directx_sdk.xapofx.fxreverb_parameters float Diffusion float Diffusion
Size of the room. Value must be between FXREVERB_MIN_ROOMSIZE and FXREVERB_MAX_ROOMSIZE. Note that physical meaning of RoomSize is subjective and not tied to any particular units. A smaller value will result in reflections reaching the listener more quickly while reflections will take longer with larger values for RoomSize.
microsoft.directx_sdk.xapofx.fxreverb_parameters float RoomSize float RoomSize
Called by XAudio2 to lock the input and output configurations of an XAPO allowing it to do any final initialization beforeProcessis called on the realtime thread.

Once locked, the input and output configuration and any other locked parameters remain constant until UnLockForProcess is called. After an XAPO is locked, further calls to LockForProcess have no effect until the UnLockForProcess function is called.

An XAPO indicates what specific formats it supports through its implementation of the IsInputFormatSupported and IsOutputFormatSupported methods. An XAPO should assert the input and output configurations are supported and that any required effect-specific initialization is complete. The IsInputFormatSupported, IsOutputFormatSupported, and Initialize methods should be used as necessary before calling this method.

Because Process is a nonblocking method, all internal memory buffers required for Process should be allocated in LockForProcess.

Process is never called before LockForProcess returns successfully.

LockForProcess is called directly by XAudio2 and should not be called by the client code.

ee418455 IXAPO IXAPO
Queries if a specific input format is supported for a given output format. Output format. Input format to check for being supported. If not NULL, and the input format is not supported for the given output format, ppSupportedInputFormat returns a pointer to the closest input format that is supported. Use {{XAPOFree}} to free the returned structure. No documentation. HRESULT IXAPO::IsInputFormatSupported([None] const WAVEFORMATEX* pOutputFormat,[None] const WAVEFORMATEX* pRequestedInputFormat,[Out, Optional] WAVEFORMATEX** ppSupportedInputFormat) Queries if a specific output format is supported for a given input format. [in] Input format. [in] Output format to check for being supported. [out] If not NULL and the output format is not supported for the given input format, ppSupportedOutputFormat returns a pointer to the closest output format that is supported. Use {{XAPOFree}} to free the returned structure. No documentation. HRESULT IXAPO::IsOutputFormatSupported([None] const WAVEFORMATEX* pInputFormat,[None] const WAVEFORMATEX* pRequestedOutputFormat,[Out, Optional] WAVEFORMATEX** ppSupportedOutputFormat) Performs any effect-specific initialization. Effect-specific initialization parameters, may be NULL if DataByteSize is 0. No documentation. HRESULT IXAPO::Initialize([In, Buffer, Optional] const void* pData,[None] UINT32 DataByteSize) Resets variables dependent on frame history. void IXAPO::Reset() Called by XAudio2 to lock the input and output configurations of an XAPO allowing it to do any final initialization before {{Process}} is called on the realtime thread. Array of input structures.pInputLockedParameters may be NULL if InputLockedParameterCount is 0, otherwise itmust have InputLockedParameterCount elements. Array of output structures.pOutputLockedParameters may be NULL if OutputLockedParameterCount is 0, otherwise itmust have OutputLockedParameterCount elements. No documentation. HRESULT IXAPO::LockForProcess([None] UINT32 InputLockedParameterCount,[In, Buffer, Optional] const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters,[None] UINT32 OutputLockedParameterCount,[In, Buffer, Optional] const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters) Deallocates variables that were allocated with the {{LockForProcess}} method. void IXAPO::UnlockForProcess() Runs the XAPO's digital signal processing (DSP) code on the given input and output buffers. [in] Input array of structures. [in, out] Output array of structures. On input, the value of .ValidFrameCount indicates the number of frames that the XAPO should write to the output buffer. On output, the value of .ValidFrameCount indicates the actual number of frames written. TRUE to process normally; FALSE to process thru. See Remarks for additional information. void IXAPO::Process([None] UINT32 InputProcessParameterCount,[In, Buffer, Optional] const XAPO_PROCESS_BUFFER_PARAMETERS* pInputProcessParameters,[None] UINT32 OutputProcessParameterCount,[InOut, Buffer, Optional] XAPO_PROCESS_BUFFER_PARAMETERS* pOutputProcessParameters,[None] BOOL IsEnabled) Returns the number of input frames required to generate the given number of output frames. The number of output frames desired. No documentation. UINT32 IXAPO::CalcInputFrames([None] UINT32 OutputFrameCount) Returns the number of output frames that will be generated from a given number of input frames. The number of input frames. No documentation. UINT32 IXAPO::CalcOutputFrames([None] UINT32 InputFrameCount) Returns the registration properties of an XAPO. a structure containing theregistration properties the XAPO was created with; use XAPOFree to free thestructure. HRESULT IXAPO::GetRegistrationProperties([Out] XAPO_REGISTRATION_PROPERTIES** ppRegistrationProperties) Called by XAudio2 to lock the input and output configurations of an XAPO allowing it to do any final initialization beforeProcessis called on the realtime thread.

Once locked, the input and output configuration and any other locked parameters remain constant until UnLockForProcess is called. After an XAPO is locked, further calls to LockForProcess have no effect until the UnLockForProcess function is called.

An XAPO indicates what specific formats it supports through its implementation of the IsInputFormatSupported and IsOutputFormatSupported methods. An XAPO should assert the input and output configurations are supported and that any required effect-specific initialization is complete. The IsInputFormatSupported, IsOutputFormatSupported, and Initialize methods should be used as necessary before calling this method.

Because Process is a nonblocking method, all internal memory buffers required for Process should be allocated in LockForProcess.

Process is never called before LockForProcess returns successfully.

LockForProcess is called directly by XAudio2 and should not be called by the client code.

ee418455 IXAPO IXAPO Native Accessor to an existing AudioProcessor instance
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. Returns the registration properties of an XAPO.
Receives a reference to a structure containing theregistration properties the XAPO was created with; use XAPOFree to free thestructure.

Returns if successful; returns an error code otherwise.

microsoft.directx_sdk.ixapo.ixapo.getregistrationproperties HRESULT IXAPO::GetRegistrationProperties([Out] XAPO_REGISTRATION_PROPERTIES** ppRegistrationProperties) IXAPO::GetRegistrationProperties
Queries if a specific input format is supported for a given output format.
Output format.
Input format to check for being supported.
If not null, and the input format is not supported for the given output format, ppSupportedInputFormat returns a reference to the closest input format that is supported. Use XAPOFree to free the returned structure.

Returns if the format pair is supported. Returns XAPO_E_FORMAT_UNSUPPORTED if the format pair is not supported.

The and IsInputFormatSupported methods allow an XAPO to indicate which audio formats it is capable of processing. If a requested format is not supported, the XAPO should return the closest format that it does support. The closest format should be determined based on frame rate, bit depth, and channel count, in that order of importance. The behavior of IsInputFormatSupported is allowed to change, based on the internal state of the XAPO, but its behavior should remain constant between calls to the and methods.

ee418453 HRESULT IXAPO::IsInputFormatSupported([In] const WAVEFORMATEX* pOutputFormat,[In] const WAVEFORMATEX* pRequestedInputFormat,[Out, Optional] WAVEFORMATEX** ppSupportedInputFormat) IXAPO::IsInputFormatSupported
Queries if a specific output format is supported for a given input format.
[in] Input format.
[in] Output format to check for being supported.
[out] If not null and the output format is not supported for the given input format, ppSupportedOutputFormat returns a reference to the closest output format that is supported. Use XAPOFree to free the returned structure.

Returns if the format pair is supported. Returns XAPO_E_FORMAT_UNSUPPORTED if the format pair is not supported.

The and IsOutputFormatSupported methods allow an XAPO to indicate which audio formats it is capable of processing. If a requested format is not supported, the XAPO should return the closest format that it does support. The closest format should be determined based on frame rate, bit depth, and channel count, in that order of importance. The behavior of IsOutputFormatSupported is allowed to change, based on the internal state of the XAPO, but its behavior should remain constant between calls to the and methods.

ee418454 HRESULT IXAPO::IsOutputFormatSupported([In] const WAVEFORMATEX* pInputFormat,[In] const WAVEFORMATEX* pRequestedOutputFormat,[Out, Optional] WAVEFORMATEX** ppSupportedOutputFormat) IXAPO::IsOutputFormatSupported
Performs any effect-specific initialization.
Effect-specific initialization parameters, may be null if DataByteSize is 0.
Size of pData in bytes, may be 0 if pData is null.

Returns if successful, an error code otherwise.

The contents of pData are defined by a given XAPO. Immutable parameters (constant for the lifetime of the XAPO) should be set in this method. Once initialized, an XAPO cannot be initialized again. An XAPO should be initialized before passing it to XAudio2 as part of an effect chain.

Note
XAudio2 does not call this method, it should be called by the client before passing the XAPO to XAudio2.
microsoft.directx_sdk.ixapo.ixapo.initialize HRESULT IXAPO::Initialize([In, Buffer, Optional] const void* pData,[In] unsigned int DataByteSize) IXAPO::Initialize
Resets variables dependent on frame history.

Constant and locked parameters such as the input and output formats remain unchanged. Variables set by remain unchanged.

For example, an effect with delay should zero out its delay line during this method, but should not reallocate anything as the XAPO remains locked with a constant input and output configuration.

XAudio2 only calls this method if the XAPO is locked.

This method is called from the realtime thread and should not block.

microsoft.directx_sdk.ixapo.ixapo.reset void IXAPO::Reset() IXAPO::Reset
Called by XAudio2 to lock the input and output configurations of an XAPO allowing it to do any final initialization beforeProcessis called on the realtime thread. No documentation. No documentation. No documentation. No documentation.

Returns if successful, an error code otherwise.

Once locked, the input and output configuration and any other locked parameters remain constant until UnLockForProcess is called. After an XAPO is locked, further calls to LockForProcess have no effect until the UnLockForProcess function is called.

An XAPO indicates what specific formats it supports through its implementation of the IsInputFormatSupported and IsOutputFormatSupported methods. An XAPO should assert the input and output configurations are supported and that any required effect-specific initialization is complete. The IsInputFormatSupported, IsOutputFormatSupported, and Initialize methods should be used as necessary before calling this method.

Because Process is a nonblocking method, all internal memory buffers required for Process should be allocated in LockForProcess.

Process is never called before LockForProcess returns successfully.

LockForProcess is called directly by XAudio2 and should not be called by the client code.

microsoft.directx_sdk.ixapo.ixapo.lockforprocess HRESULT IXAPO::LockForProcess([In] unsigned int InputLockedParameterCount,[In, Buffer] const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters,[In] unsigned int OutputLockedParameterCount,[In, Buffer] const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters) IXAPO::LockForProcess
Deallocates variables that were allocated with theLockForProcessmethod.

Unlocking an XAPO instance allows it to be reused with different input and output formats.

ee418460 void IXAPO::UnlockForProcess() IXAPO::UnlockForProcess
Runs the XAPO's digital signal processing (DSP) code on the given input and output buffers.
[in] Number of elements in pInputProcessParameters.
Note
XAudio2 currently supports only one input stream and one output stream.
[in] Input array of structures.
[in] Number of elements in pOutputProcessParameters.
Note
XAudio2 currently supports only one input stream and one output stream.
[in, out] Output array of structures. On input, the value of .ValidFrameCount indicates the number of frames that the XAPO should write to the output buffer. On output, the value of .ValidFrameCount indicates the actual number of frames written.
TRUE to process normally; to process thru. See Remarks for additional information.

Implementations of this function should not block, as the function is called from the realtime audio processing thread.

All code that could cause a delay, such as format validation and memory allocation, should be put in the method, which is not called from the realtime audio processing thread.

For in-place processing, the pInputProcessParameters parameter will not necessarily be the same as pOutputProcessParameters. Rather, their pBuffer members will point to the same memory.

Multiple input and output buffers may be used with in-place XAPOs, though the input buffer count must equal the output buffer count. For in-place processing when multiple input and output buffers are used, the XAPO may assume the number of input buffers equals the number of output buffers.

In addition to writing to the output buffer, as appropriate, an XAPO is responsible for setting the output stream's buffer flags and valid frame count.

When IsEnabled is , the XAPO should not apply its normal processing to the given input/output buffers during. It should instead pass data from input to output with as little modification possible. Effects that perform format conversion should continue to do so. Effects must ensure transitions between normal and thru processing do not introduce discontinuities into the signal.

When writing a Process method, it is important to note XAudio2 audio data is interleaved, which means data from each channel is adjacent for a particular sample number. For example, if there was a 4-channel wave playing into an XAudio2 source voice, the audio data would be a sample of channel 0, a sample of channel 1, a sample of channel 2, a sample of channel 3, and then the next sample of channels 0, 1, 2, 3, and so on.

microsoft.directx_sdk.ixapo.ixapo.process void IXAPO::Process([In] unsigned int InputProcessParameterCount,[In, Buffer, Optional] const XAPO_PROCESS_BUFFER_PARAMETERS* pInputProcessParameters,[In] unsigned int OutputProcessParameterCount,[In, Buffer] XAPO_PROCESS_BUFFER_PARAMETERS* pOutputProcessParameters,[In] BOOL IsEnabled) IXAPO::Process
Returns the number of input frames required to generate the given number of output frames.
The number of output frames desired.

Returns the number of input frames required.

XAudio2 calls this method to determine what size input buffer an XAPO requires to generate the given number of output frames. This method only needs to be called once while an XAPO is locked. CalcInputFrames is only called by XAudio2 if the XAPO is locked.

This function should not block, because it may be called from the realtime audio processing thread.

microsoft.directx_sdk.ixapo.ixapo.calcinputframes unsigned int IXAPO::CalcInputFrames([In] unsigned int OutputFrameCount) IXAPO::CalcInputFrames
Returns the number of output frames that will be generated from a given number of input frames.
The number of input frames.

Returns the number of output frames that will be produced.

XAudio2 calls this method to determine how large of an output buffer an XAPO will require for a certain number of input frames. CalcOutputFrames is only called by XAudio2 if the XAPO is locked.

This function should not block, because it may be called from the realtime audio processing thread.

ee418450 unsigned int IXAPO::CalcOutputFrames([In] unsigned int InputFrameCount) IXAPO::CalcOutputFrames
Queries if a specific input format is supported for a given output format. Output format. Input format to check for being supported. If not NULL, and the input format is not supported for the given output format, ppSupportedInputFormat returns a pointer to the closest input format that is supported. Use {{XAPOFree}} to free the returned structure. No documentation. HRESULT IXAPO::IsInputFormatSupported([None] const WAVEFORMATEX* pOutputFormat,[None] const WAVEFORMATEX* pRequestedInputFormat,[Out, Optional] WAVEFORMATEX** ppSupportedInputFormat) Queries if a specific output format is supported for a given input format. [in] Input format. [in] Output format to check for being supported. [out] If not NULL and the output format is not supported for the given input format, ppSupportedOutputFormat returns a pointer to the closest output format that is supported. Use {{XAPOFree}} to free the returned structure. No documentation. HRESULT IXAPO::IsOutputFormatSupported([None] const WAVEFORMATEX* pInputFormat,[None] const WAVEFORMATEX* pRequestedOutputFormat,[Out, Optional] WAVEFORMATEX** ppSupportedOutputFormat) Performs any effect-specific initialization. Effect-specific initialization parameters, may be NULL if DataByteSize is 0. No documentation. HRESULT IXAPO::Initialize([In, Buffer, Optional] const void* pData,[None] UINT32 DataByteSize) Resets variables dependent on frame history. void IXAPO::Reset() Called by XAudio2 to lock the input and output configurations of an XAPO allowing it to do any final initialization before {{Process}} is called on the realtime thread. Array of input structures.pInputLockedParameters may be NULL if InputLockedParameterCount is 0, otherwise itmust have InputLockedParameterCount elements. Array of output structures.pOutputLockedParameters may be NULL if OutputLockedParameterCount is 0, otherwise itmust have OutputLockedParameterCount elements. No documentation. HRESULT IXAPO::LockForProcess([None] UINT32 InputLockedParameterCount,[In, Buffer, Optional] const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters,[None] UINT32 OutputLockedParameterCount,[In, Buffer, Optional] const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters) Deallocates variables that were allocated with the {{LockForProcess}} method. void IXAPO::UnlockForProcess() Runs the XAPO's digital signal processing (DSP) code on the given input and output buffers. [in] Input array of structures. [in, out] Output array of structures. On input, the value of .ValidFrameCount indicates the number of frames that the XAPO should write to the output buffer. On output, the value of .ValidFrameCount indicates the actual number of frames written. TRUE to process normally; FALSE to process thru. See Remarks for additional information. void IXAPO::Process([None] UINT32 InputProcessParameterCount,[In, Buffer, Optional] const XAPO_PROCESS_BUFFER_PARAMETERS* pInputProcessParameters,[None] UINT32 OutputProcessParameterCount,[InOut, Buffer, Optional] XAPO_PROCESS_BUFFER_PARAMETERS* pOutputProcessParameters,[None] BOOL IsEnabled) Returns the number of input frames required to generate the given number of output frames. The number of output frames desired. No documentation. UINT32 IXAPO::CalcInputFrames([None] UINT32 OutputFrameCount) Returns the number of output frames that will be generated from a given number of input frames. The number of input frames. No documentation. UINT32 IXAPO::CalcOutputFrames([None] UINT32 InputFrameCount) Returns the registration properties of an XAPO. a structure containing theregistration properties the XAPO was created with; use XAPOFree to free thestructure. HRESULT IXAPO::GetRegistrationProperties([Out] XAPO_REGISTRATION_PROPERTIES** ppRegistrationProperties) Retrieves the requested interface reference if the XAPO supports it.

XAPO instances are passed to XAudio2 as interfaces and XAudio2 uses QueryInterface to acquire an interface and to detect whether the XAPO implements the interface. Implementations of must accept requests for __uuidof() and if is implemented must also accept requests for __uuidof().

ee418445 IXAPOParameters IXAPOParameters
Sets effect-specific parameters. Effect-specific parameter block. void IXAPOParameters::SetParameters([In, Buffer] const void* pParameters,[None] UINT32 ParameterByteSize) Gets the current values for any effect-specific parameters. [in, out] Receives an effect-specific parameter block. void IXAPOParameters::GetParameters([Out, Buffer] void* pParameters,[None] UINT32 ParameterByteSize) Retrieves the requested interface reference if the XAPO supports it.

XAPO instances are passed to XAudio2 as interfaces and XAudio2 uses QueryInterface to acquire an interface and to detect whether the XAPO implements the interface. Implementations of must accept requests for __uuidof() and if is implemented must also accept requests for __uuidof().

ee418445 IXAPOParameters IXAPOParameters
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. Sets effect-specific parameters.
Effect-specific parameter block.
Size of pParameters, in bytes.

The data in pParameters is completely effect-specific and determined by the implementation of the function. The data passed to SetParameters can be used to set the state of the XAPO and control the behavior of the function.

SetParameters can only be called on the real-time audio processing thread; no synchronization between SetParameters and the method is necessary. However, the method may be called from any thread as it adds in the required synchronization to deliver a copy (asynchronously) of the parameters to SetParameters on the real-time thread; no synchronization between and the method is necessary.

ee418447 void IXAPOParameters::SetParameters([In, Buffer] const void* pParameters,[In] unsigned int ParameterByteSize) IXAPOParameters::SetParameters
Gets the current values for any effect-specific parameters.
[in, out] Receives an effect-specific parameter block.
[in] Size of pParameters, in bytes.

The data in pParameters is completely effect-specific and determined by the implementation of the function. The data returned in pParameters can be used to provide information about the current state of the XAPO.

Unlike SetParameters, XAudio2 does not call this method on the realtime audio processing thread. Thus, the XAPO must protect variables shared with or using appropriate synchronization. The CXAPOParametersBase class is an implementation of and its implementation of GetParameters efficiently handles this synchronization for the user.

XAudio2 calls this method from the method.

This method may block and should never be called from the realtime audio processing thread instead get the current parameters from CXAPOParametersBase::BeginProcess.

ee418443 void IXAPOParameters::GetParameters([Out, Buffer] void* pParameters,[In] unsigned int ParameterByteSize) IXAPOParameters::GetParameters
Defines stream buffer parameters that may change from one call to the next. Used with theProcessmethod.

Although the format and maximum size values of a particular stream buffer are constant, as defined by the XAPO_LOCKFORPROCESS_PARAMETERS structure, the actual memory address of the stream buffer is permitted to change. For constant-bit-rate (CBR) XAPOs, ValidFrameCount is constant and is always equal to the corresponding XAPO_LOCKFORPROCESS_PARAMETERS.MaxFrameCount for this buffer.

Note
Only constant-bit-rate XAPOs are currently supported.
ee419209 XAPO_PROCESS_BUFFER_PARAMETERS XAPO_PROCESS_BUFFER_PARAMETERS
No documentation. void* pBuffer void pBuffer No documentation. XAPO_BUFFER_FLAGS BufferFlags XAPO_BUFFER_FLAGS BufferFlags No documentation. unsigned int ValidFrameCount unsigned int ValidFrameCount No documentation. XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS No documentation. const WAVEFORMATEX* pFormat WAVEFORMATEX pFormat No documentation. unsigned int MaxFrameCount unsigned int MaxFrameCount Gets or sets the waveformat. The format. Describes general characteristics of an XAPO. Used withIXAPO::GetRegistrationPropertiesandCXAPOBase::CXAPOBase. microsoft.directx_sdk.xapo.xapo_registration_properties XAPO_REGISTRATION_PROPERTIES XAPO_REGISTRATION_PROPERTIES No documentation. GUID clsid GUID clsid No documentation. wchar_t FriendlyName[256] wchar_t FriendlyName No documentation. wchar_t CopyrightInfo[256] wchar_t CopyrightInfo No documentation. unsigned int MajorVersion unsigned int MajorVersion No documentation. unsigned int MinorVersion unsigned int MinorVersion No documentation. XAPO_PROPERTY_TYPE Flags XAPO_PROPERTY_TYPE Flags No documentation. unsigned int MinInputBufferCount unsigned int MinInputBufferCount No documentation. unsigned int MaxInputBufferCount unsigned int MaxInputBufferCount No documentation. unsigned int MinOutputBufferCount unsigned int MinOutputBufferCount No documentation. unsigned int MaxOutputBufferCount unsigned int MaxOutputBufferCount The namespace provides a managed XAudio2 API. hh405049 XAudio2 XAudio2 Internal VoiceCallback callback Impl Return a pointer to the unamanged version of this callback. The callback. A pointer to a shadow c++ callback The namespace provides a managed X3DAudio API. ee415714 X3DAudio X3DAudio Base AudioProcessor class that implements methods from . This class is also providing its parameter through a generic. type of the parameter for this AudioProcessor Queries if a specific input format is supported for a given output format. Output format. Input format to check for being supported. If not NULL, and the input format is not supported for the given output format, ppSupportedInputFormat returns a pointer to the closest input format that is supported. Use {{XAPOFree}} to free the returned structure. No documentation. HRESULT IXAPO::IsInputFormatSupported([None] const WAVEFORMATEX* pOutputFormat,[None] const WAVEFORMATEX* pRequestedInputFormat,[Out, Optional] WAVEFORMATEX** ppSupportedInputFormat) Queries if a specific output format is supported for a given input format. [in] Input format. [in] Output format to check for being supported. [out] If not NULL and the output format is not supported for the given input format, ppSupportedOutputFormat returns a pointer to the closest output format that is supported. Use {{XAPOFree}} to free the returned structure. No documentation. HRESULT IXAPO::IsOutputFormatSupported([None] const WAVEFORMATEX* pInputFormat,[None] const WAVEFORMATEX* pRequestedOutputFormat,[Out, Optional] WAVEFORMATEX** ppSupportedOutputFormat) Performs any effect-specific initialization. Effect-specific initialization parameters, may be NULL if DataByteSize is 0. No documentation. HRESULT IXAPO::Initialize([In, Buffer, Optional] const void* pData,[None] UINT32 DataByteSize) Resets variables dependent on frame history. void IXAPO::Reset() Called by XAudio2 to lock the input and output configurations of an XAPO allowing it to do any final initialization before {{Process}} is called on the realtime thread. Array of input structures.pInputLockedParameters may be NULL if InputLockedParameterCount is 0, otherwise itmust have InputLockedParameterCount elements. Array of output structures.pOutputLockedParameters may be NULL if OutputLockedParameterCount is 0, otherwise itmust have OutputLockedParameterCount elements. No documentation. HRESULT IXAPO::LockForProcess([None] UINT32 InputLockedParameterCount,[In, Buffer, Optional] const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters,[None] UINT32 OutputLockedParameterCount,[In, Buffer, Optional] const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters) Deallocates variables that were allocated with the {{LockForProcess}} method. void IXAPO::UnlockForProcess() Runs the XAPO's digital signal processing (DSP) code on the given input and output buffers. [in] Input array of structures. [in, out] Output array of structures. On input, the value of .ValidFrameCount indicates the number of frames that the XAPO should write to the output buffer. On output, the value of .ValidFrameCount indicates the actual number of frames written. TRUE to process normally; FALSE to process thru. See Remarks for additional information. void IXAPO::Process([None] UINT32 InputProcessParameterCount,[In, Buffer, Optional] const XAPO_PROCESS_BUFFER_PARAMETERS* pInputProcessParameters,[None] UINT32 OutputProcessParameterCount,[InOut, Buffer, Optional] XAPO_PROCESS_BUFFER_PARAMETERS* pOutputProcessParameters,[None] BOOL IsEnabled) Returns the number of input frames required to generate the given number of output frames. The number of output frames desired. No documentation. UINT32 IXAPO::CalcInputFrames([None] UINT32 OutputFrameCount) Returns the number of output frames that will be generated from a given number of input frames. The number of input frames. No documentation. UINT32 IXAPO::CalcOutputFrames([None] UINT32 InputFrameCount) Sets effect-specific parameters. Effect-specific parameter block. void IXAPOParameters::SetParameters([In, Buffer] const void* pParameters,[None] UINT32 ParameterByteSize) Gets the current values for any effect-specific parameters. [in, out] Receives an effect-specific parameter block. void IXAPOParameters::GetParameters([Out, Buffer] void* pParameters,[None] UINT32 ParameterByteSize) Return parameters Gets the input format locked. The input format locked. Gets the output format locked. The output format locked. Gets the max frame count locked. The max frame count locked. Returns the registration properties of an XAPO. a structure containing theregistration properties the XAPO was created with; use XAPOFree to free thestructure. HRESULT IXAPO::GetRegistrationProperties([Out] XAPO_REGISTRATION_PROPERTIES** ppRegistrationProperties) Implements this class to call an existing unmanaged AudioProcessor which supports parameter. the parameter type of this AudioProcessor Initializes a new instance of the class. The base PTR. Update the Native Poinder. Rebuild ParameterProviderNative. Get or Set the parameters for this AudioProcessor Internal AudioProcessorShadow IXAPO GUID Return a pointer to the unamanged version of this callback. The callback. A pointer to a shadow c++ callback HRESULT IXAPO::GetRegistrationProperties([Out] XAPO_REGISTRATION_PROPERTIES** ppRegistrationProperties) HRESULT IXAPO::IsInputFormatSupported([None] const WAVEFORMATEX* pOutputFormat,[None] const WAVEFORMATEX* pRequestedInputFormat,[Out, Optional] WAVEFORMATEX** ppSupportedInputFormat) HRESULT IXAPO::IsOutputFormatSupported([None] const WAVEFORMATEX* pInputFormat,[None] const WAVEFORMATEX* pRequestedOutputFormat,[Out, Optional] WAVEFORMATEX** ppSupportedOutputFormat) HRESULT IXAPO::Initialize([In, Buffer, Optional] const void* pData,[None] UINT32 DataByteSize) void IXAPO::Reset() HRESULT IXAPO::LockForProcess([None] UINT32 InputLockedParameterCount,[In, Buffer, Optional] const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters,[None] UINT32 OutputLockedParameterCount,[In, Buffer, Optional] const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters) Deallocates variables that were allocated with the {{LockForProcess}} method. void IXAPO::UnlockForProcess() void IXAPO::Process([None] UINT32 InputProcessParameterCount,[In, Buffer, Optional] const XAPO_PROCESS_BUFFER_PARAMETERS* pInputProcessParameters,[None] UINT32 OutputProcessParameterCount,[InOut, Buffer, Optional] XAPO_PROCESS_BUFFER_PARAMETERS* pOutputProcessParameters,[None] BOOL IsEnabled) Returns the number of input frames required to generate the given number of output frames. This pointer The number of output frames desired. No documentation. UINT32 IXAPO::CalcInputFrames([None] UINT32 OutputFrameCount) Returns the number of output frames that will be generated from a given number of input frames. This Pointer The number of input frames. No documentation. UINT32 IXAPO::CalcOutputFrames([None] UINT32 InputFrameCount) An Echo XAPO AudioProcessor Initializes a new instance of the class. A Equalizer XAPO AudioProcessor Initializes a new instance of the class. A MateringLimiter XAPO AudioProcessor Initializes a new instance of the class. A Reverb XAPO AudioProcessor Initializes a new instance of the class. Internal AudioProcessorShadow IXAPOParameters Return a pointer to the unamanged version of this callback. The callback. A pointer to a shadow c++ callback Sets effect-specific parameters. This pointer Effect-specific parameter block. size of the parameters void IXAPOParameters::SetParameters([In, Buffer] const void* pParameters,[None] UINT32 ParameterByteSize) Gets the current values for any effect-specific parameters. This pointer [in, out] Receives an effect-specific parameter block. size of the parameters void IXAPOParameters::GetParameters([Out, Buffer] void* pParameters,[None] UINT32 ParameterByteSize) A Reverb XAudio2 AudioProcessor. Initializes a new instance of the class. Initializes a new instance of the class. A VolumeMeter XAudio2 AudioProcessor. Initializes a new instance of the class. Initializes a new instance of the class.