Skip to content

Instantly share code, notes, and snippets.

@stolk
Last active April 7, 2018 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stolk/92763561972b427c529baeb1a92fe788 to your computer and use it in GitHub Desktop.
Save stolk/92763561972b427c529baeb1a92fe788 to your computer and use it in GitHub Desktop.
An OPENSL-ES error as a string.
static const char* sl_error_str( SLresult result )
{
switch( result )
{
case SL_RESULT_SUCCESS: return "success";
case SL_RESULT_PRECONDITIONS_VIOLATED: return "preconditions violated";
case SL_RESULT_PARAMETER_INVALID: return "parameter invalid";
case SL_RESULT_MEMORY_FAILURE: return "memory failure";
case SL_RESULT_RESOURCE_ERROR: return "resource error";
case SL_RESULT_RESOURCE_LOST: return "resource lost";
case SL_RESULT_IO_ERROR: return "io error";
case SL_RESULT_BUFFER_INSUFFICIENT: return "buffer insufficient";
case SL_RESULT_CONTENT_CORRUPTED: return "content corrupted";
case SL_RESULT_CONTENT_UNSUPPORTED: return "content unsupported";
case SL_RESULT_CONTENT_NOT_FOUND: return "content not found";
case SL_RESULT_PERMISSION_DENIED: return "permission denied";
case SL_RESULT_FEATURE_UNSUPPORTED: return "geature unsupported";
case SL_RESULT_INTERNAL_ERROR: return "internal error";
case SL_RESULT_UNKNOWN_ERROR: return "unknown error";
case SL_RESULT_OPERATION_ABORTED: return "operation aborted";
case SL_RESULT_CONTROL_LOST: return "control lost";
}
return "underfined SL error";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment