IXAudio2EngineCallback::OnCriticalError Method

Called if a critical system error occurs that requires XAudio2 to be closed down and restarted.

Note

A critical error can happen when the underlying WASAPI rendering object is no longer available, such as when a headset or speaker are unplugged, a USB audio device is removed, and so on. The entire audio graph must be destroyed, audio device re-enumerated, and a new audio graph created since the various channel counts and formats could have changed.

Syntax

public:
void OnCriticalError(
         HRESULT Error
)  

Parameters

Error
Type: HRESULT 

Error code returned by XAudio2.

Return value

None.

Remarks

Once a critical error has occurred, audio processing stops and all further calls to XAudio2 fail. The only way to recover in this situation is to release the XAudio2 instance and create a new one.

For information about the IXAudio2EngineCallback interface methods, see the XAudio2 Callbacks section.

Requirements

Header: Declared in xaudio2.h.

Library: Use xaudio2.lib.

See also

IXAudio2EngineCallback

IXAudio2EngineCallback Members