Skip to content

Latest commit

 

History

History
182 lines (123 loc) · 5.69 KB

nf-xaudio2fx-xaudio2createreverb.md

File metadata and controls

182 lines (123 loc) · 5.69 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:xaudio2fx.XAudio2CreateReverb
XAudio2CreateReverb function (xaudio2fx.h)
Creates a new reverb audio processing object (APO), and returns a pointer to it.
XAudio2CreateReverb
XAudio2CreateReverb function [XAudio2 Audio Mixing APIs]
xaudio2.xaudio2createreverb
xaudio2fx/XAudio2CreateReverb
xaudio2\xaudio2createreverb.htm
xaudio2
M:Microsoft.directx_sdk.xaudio2.XAudio2CreateReverb(IUnknown@,UINT32)
12/05/2018
XAudio2CreateReverb, XAudio2CreateReverb function [XAudio2 Audio Mixing APIs], xaudio2.xaudio2createreverb, xaudio2fx/XAudio2CreateReverb
xaudio2fx.h
Windows
Xaudio2.lib
Windows.Media.Audio.dll
Windows
19H1
XAudio2CreateReverb
xaudio2fx/XAudio2CreateReverb
c++
APIRef
kbSyntax
DllExport
Windows.Media.Audio.dll
XAudio2CreateReverb

XAudio2CreateReverb function

-description

Creates a new reverb audio processing object (APO), and returns a pointer to it.

-parameters

-param ppApo [in, out]

Contains a pointer to the reverb APO that is created.

-param DEFAULT [in]

Flags that specify the behavior of the APO. The value of this parameter must be 0.

-returns

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

-remarks

XAudio2CreateReverb creates an effect performing Princeton Digital Reverb. The XAPO effect library (XAPOFX) includes an alternate reverb effect. Use CreateFX to create this alternate effect.

The reverb APO supports has the following restrictions:

  • Input audio data must be FLOAT32.
  • Framerate must be within XAUDIO2FX_REVERB_MIN_FRAMERATE (20,000 Hz) and XAUDIO2FX_REVERB_MAX_FRAMERATE (48,000 Hz).
  • The input and output channels must be one of the following combinations.
    • Mono input and mono output
    • Mono input and 5.1 output
    • Stereo input and stereo output
    • Stereo input and 5.1 output
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.

Windows
Because XAudio2CreateReverb calls CoCreateInstance on Windows, 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 on Windows 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 IXAudio2Voice::SetEffectParameters.

Note  XAudio2CreateReverb is an inline function in xaudio2fx.h that calls CreateAudioReverb: ``` syntax

XAUDIO2FX_STDAPI CreateAudioReverb(Outptr IUnknown** ppApo); __inline HRESULT XAudio2CreateReverb(Outptr IUnknown** ppApo, UINT32 /Flags/ DEFAULT(0)) { return CreateAudioReverb(ppApo); }


</div>
<div> </div>
<h3><a id="Platform_Requirements"></a><a id="platform_requirements"></a><a id="PLATFORM_REQUIREMENTS"></a>Platform Requirements</h3>
Windows 10 (XAudio2.9); Windows 8, Windows Phone 8 (XAudio 2.8); DirectX SDK (XAudio 2.7)

## -see-also

<a href="/windows/desktop/xaudio2/how-to--create-an-effect-chain">How to: Create an Effect Chain</a>



<a href="/windows/desktop/api/xaudio2/nf-xaudio2-ixaudio2voice-seteffectparameters">IXAudio2Voice::SetEffectParameters</a>



<a href="/windows/desktop/api/xaudio2fx/ns-xaudio2fx-xaudio2fx_reverb_parameters">XAUDIO2FX_REVERB_PARAMETERS</a>



<a href="/windows/desktop/xaudio2/functions">XAudio2 Functions</a>