Exemplo n.º 1
0
func alsa(e C.int) error {
	if e == 0 {
		return nil
	}
	s := C.snd_strerror(e)
	msg := C.GoString(s)
	return errors.New(msg)
}
Exemplo n.º 2
0
// strError retruns string description of ALSA error by its code.
func strError(err _Ctype_int) string {
	cErrMsg := C.snd_strerror(err)

	return C.GoString(cErrMsg)
}
Exemplo n.º 3
0
func createError(errorMsg string, errorCode C.int) (err error) {
	strError := C.GoString(C.snd_strerror(errorCode))
	err = fmt.Errorf("%s: %s", errorMsg, strError)
	return
}