Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Error Codes

When a function returns a PrismError, the prism_error_string function can be used to return a human-readable string error message which can be bubbled up to applications. The numeric values of error codes are part of the ABI and will not change in future versions. Errors MAY, however, be added in future.

ErrorValueDescription
PRISM_OK0Operation completed without error
PRISM_ERROR_NOT_INITIALIZED1The backend was not initialized; prism_backend_initialize was not called or failed
PRISM_ERROR_INVALID_PARAM2An invalid parameter was passed to a function
PRISM_ERROR_NOT_IMPLEMENTED3The operation is not supported by the selected backend
PRISM_ERROR_NO_VOICES4No voices are available for this backend
PRISM_ERROR_VOICE_NOT_FOUND5The specified voice was not found
PRISM_ERROR_SPEAK_FAILURE6Speech synthesis failed
PRISM_ERROR_MEMORY_FAILURE7Memory allocation failed
PRISM_ERROR_RANGE_OUT_OF_BOUNDS8A parameter value exceeded its valid range
PRISM_ERROR_INTERNAL9An internal backend error occurred
PRISM_ERROR_NOT_SPEAKING10Attempted to stop or pause when not speaking
PRISM_ERROR_NOT_PAUSED11Attempted to resume when not paused
PRISM_ERROR_ALREADY_PAUSED12Attempted to pause when already paused
PRISM_ERROR_INVALID_UTF813A string parameter contained invalid UTF-8
PRISM_ERROR_INVALID_OPERATION14The operation is invalid in the current state
PRISM_ERROR_ALREADY_INITIALIZED15Attempted to initialize an already-initialized backend
PRISM_ERROR_BACKEND_NOT_AVAILABLE16The backend is not available on this system
PRISM_ERROR_UNKNOWN17An unspecified error occurred
PRISM_ERROR_INVALID_AUDIO_FORMAT18Either the backend speech engine or backend voice have an audio format that Prism does not know how to handle, or the parameters that the underlying speech engine provided to Prism were nonsensical.
PRISM_ERROR_INTERNAL_BACKEND_LIMIT_EXCEEDED19The backend possesses an internal hard ceiling as to how many instances may be instantiated at any given time, and this limit would be exceeded were another to be initialized.
PRISM_ERROR_BACKEND_ENTERED_UNDEFINED_STATE20An error occured when the backend was executing a function which has caused the backend to enter an undefined state. The caller should re-initialize the backend from scratch.
PRISM_ERROR_LIBRARY_LOAD_FAILED21A shared library could not be opened, because no file exists at the given path, it is not a loadable image, it was built for a different architecture, or its initialization code failed
PRISM_ERROR_LIBRARY_INVALID22A shared library was opened but does not export the plugin entry point
PRISM_ERROR_INCOMPATIBLE_ABI23A plugin declined the host, or a backend descriptor declared an ABI generation this build of Prism does not accept

The constant PRISM_ERROR_COUNT equals the total number of error codes and MAY be used for bounds checking or table sizing. This constant may increase in future versions as new error codes are added.