XAudio2CreateVolumeMeter function • • 2 minutes to read In this article Creates a new volume meter audio processing object (APO) and returns a pointer to it. Syntax HRESULT XAudio2CreateVolumeMeter( IUnknown **ppApo, UINT32 DEFAULT ); Parameters ppApo Contains the created volume meter APO. DEFAULT Flags that specify the behavior of the APO. The value of this parameter must be 0. Return Value If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. Remarks For information on creating new effects for use with XAudio2, see the. Windows Because XAudio2CreateVolumeMeter calls CoCreateInstance on Windows, the application must have called the CoInitializeEx method before calling XAudio2CreateVolumeMeter. Has the same requirement, which means CoInitializeEx typically will be called long before XAudio2CreateVolumeMeter 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 * pVolumeMeterAPO; XAudio2CreateVolumeMeter(&pVolumeMeterAPO); The xaudio2fx.h header defines the AudioVolumeMeter class GUID as a cross-platform audio processing object (XAPO). Class __declspec(uuid('4FC3B166-972A-40CF-BC37-7DB03DB2FBA3')) AudioVolumeMeter; XAudio2CreateVolumeMeter returns this object as a pointer to a pointer to in the ppApo parameter. Although you can query the and interfaces from this IUnknown, you typically never use these interfaces directly. You may have received an error message about XAudio2 when installing. To fix the problem, you need to download an installation file from Microsoft from. ![]() ![]() Instead, you use them when you create a voice to add them as part of the effects chain. The volume meter uses the parameter structure that you access via the method when the XAPO is bound to the audio graph. The likely problem is that your application(s) are using the XAUDIO2_DEBUG_ENGINE flag (which the samples all do by default when you are building the DEBUG configuration rather than the RELEASE configuration). That mean it is looking for class GUID: DEFINE_CLSID(XAudio2_Debug, db05ea35, 0329, 4d4b, a5, 3a, 6d, ea, d0, 3d, 38, 52); rather than the release version: DEFINE_CLSID(XAudio2, 5a508685, a254, 4fba, 9b, 82, 9a, 24, b0, 03, 06, af); The debug versions of XAUDIO2 (and other components) are NOT installed by the DirectX End-User Runtime REDIST package. The debug versions are only installed by the DirectX SDK as part of the Developer Runtime. Either run the RELEASE configuration on that notebook, or install the DirectX SDK on that notebook to get the Developer Runtime (and the debug versions of XAUDIO2) installed.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2019
Categories |