Handling Errors with Audio Functions

[The feature associated with this page, Waveform Audio, is a legacy feature. It has been superseded by WASAPI and Audio Graphs. WASAPI and Audio Graphs have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use WASAPI and Audio Graphs instead of Waveform Audio, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The waveform-audio and auxiliary-audio functions return a nonzero value when an error occurs. Windows provides functions that convert these error values into textual descriptions of the errors. The application must still examine the error values to determine how to proceed, but textual descriptions of errors can be used in dialog boxes that describe errors to users.

You can use the following functions to retrieve textual descriptions of audio error values:

Function Description
waveInGetErrorText Retrieves a textual description of a specified waveform-audio input error.
waveOutGetErrorText Retrieves a textual description of a specified waveform-audio output error.

 

The only audio functions that do not return error values are auxGetNumDevs, waveInGetNumDevs, and waveOutGetNumDevs. These functions return zero if no devices are present in a system or if they encounter any errors.