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.
public:
void OnCriticalError(
HRESULT Error
)
Error
Type: HRESULTÂ
Error code returned by XAudio2.
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.
Header: Declared in xaudio2.h.
Library: Use xaudio2.lib.