Creates a new reverb audio processing object (APO), and returns a pointer to it.
HRESULT XAudio2CreateReverb(
IUnknown **ppApo,
UINT32 Flags
)
ppApo
Type: IUnknown **
[out] Contains a pointer to the reverb APO that is created.
Flags
Type: UINT32
The value of this parameter must be 0.
Type: HRESULT
See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.
XAudio2CreateReverb creates an effect performing Princeton Digital Reverb. The XAPO effect library (XAPOFX) includes an alternate reverb effect (refer to the XAPOFX Overview.
The reverb APO supports has the following restrictions:
The reverb APO maintains internal state information between processing samples. You can only use an instance of the APO with one source of audio data at a time. Multiple voices that require reverb effects would each need to create a separate reverb effect with XAudio2CreateReverb.
For information about creating new effects for use with XAudio2, see the XAPO Overview.
Because XAudio2CreateReverb calls CoCreateInstance, the application must have called the CoInitializeEx method before calling XAudio2CreateReverb. XAudio2Create has the same requirement, which means CoInitializeEx typically will be called long before XAudio2CreateReverb is called.
A typical calling pattern would be as follows:
#ifndef _XBOX
CoInitializeEx(NULL, COINIT_MULTITHREADED);
#endif
IXAudio2* pXAudio2 = NULL;
HRESULT hr;
if ( FAILED(hr = XAudio2Create( &pXAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR ) ) )
return hr;
...
IUnknown * pReverbAPO;
XAudio2CreateReverb(&pReverbAPO);
|
The xaudio2fx.h header defines the AudioReverb class GUID as a cross-platform audio processing object (XAPO).
class __declspec(uuid("C2633B16-471B-4498-B8C5-4F0959E2EC09")) AudioReverb;
XAudio2CreateReverb returns this object as a pointer to a pointer to IUnknown in the ppApo parameter. Although you can query the IXAPO and IXAPOParameters interfaces from this IUnknown, you typically never use these interfaces directly. Instead, you use them when you create a voice to add them as part of the effects chain.
The reverb uses the XAUDIO2FX_REVERB_PARAMETERS parameter structure that you access via the SetEffectParameters.
Note
XAudio2CreateReverb is an inline function in xaudio2fx.h that calls CreateAudioReverb:
C++C++
XAUDIO2FX_STDAPI CreateAudioReverb(_Outptr_ IUnknown** ppApo); __inline HRESULT XAudio2CreateReverb(_Outptr_ IUnknown** ppApo, UINT32 /*Flags*/ DEFAULT(0)) { return CreateAudioReverb(ppApo); }</td></tr>
</table>
Header: Declared in xaudio2fx.h.
Library: Use xaudio2.lib.