Module audio::audio_error
audio & MIDI: the error value both APIs return.
std/audio reports failures the way the rest of std does (no exceptions): an operation returns an AudioError — 'code' is AUDIO_OK (0) on success or one of the AUDIO_ERR_* codes below, 'message' a human-readable line for the log (the backend's own error text where it has one: ALSA's snd_strerror(), an HRESULT, a Core Audio OSStatus) — or, when it also produces a value, a std::Result<T, AudioError> (see std/result.h):
struct Result<Audio, AudioError> r = std::Audio::open(AUDIO_API_UNSPECIFIED);
match (r.get_err()) { case some(e): printf("%s\n", e.message); case null: {} }
Shared by audio.h and midi.h.
Structs
| AudioError |
Functions
| audio_error_name | The fixed English name of an AUDIO_ERR_* code ("unsupported", ...). |
Macros
| AUDIO_OK | |
| AUDIO_ERR_WARNING | non-fatal (e.g. realtime priority refused) |
| AUDIO_ERR_UNSUPPORTED | the API isn't compiled in / can't do this |
| AUDIO_ERR_NO_DEVICES | no (default) device to use |
| AUDIO_ERR_INVALID_DEVICE | no device/port with that id/index |
| AUDIO_ERR_INVALID_PARAM | a parameter the API can't accept |
| AUDIO_ERR_INVALID_USE | wrong state (start an unopened stream, ...) |
| AUDIO_ERR_DEVICE_BUSY | the device is in use (exclusive mode) |
| AUDIO_ERR_SYSTEM | the OS / library call failed |
| AUDIO_ERR_THREAD | couldn't start the stream thread |
| AUDIO_ERR_NO_MEMORY | allocation failed (open time only) |
| AUDIO_ERR_UNAVAILABLE | the backend's library/server isn't there |
| AUDIO_ERROR_MESSAGE_MAX |