Updated everything for dependencies. All sub packages are now part of the project. This was a massive update, hopefully won't have to be reverted.
This commit is contained in:
36
gumble/go-opus/errors.go
Normal file
36
gumble/go-opus/errors.go
Normal file
@ -0,0 +1,36 @@
|
||||
// Copyright © Go Opus Authors (see AUTHORS file)
|
||||
//
|
||||
// License for use of this code is detailed in the LICENSE file
|
||||
|
||||
package opus
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
/*
|
||||
#cgo pkg-config: opus
|
||||
#include <opus.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
type Error int
|
||||
|
||||
var _ error = Error(0)
|
||||
|
||||
// Libopus errors
|
||||
const (
|
||||
ErrOK = Error(C.OPUS_OK)
|
||||
ErrBadArg = Error(C.OPUS_BAD_ARG)
|
||||
ErrBufferTooSmall = Error(C.OPUS_BUFFER_TOO_SMALL)
|
||||
ErrInternalError = Error(C.OPUS_INTERNAL_ERROR)
|
||||
ErrInvalidPacket = Error(C.OPUS_INVALID_PACKET)
|
||||
ErrUnimplemented = Error(C.OPUS_UNIMPLEMENTED)
|
||||
ErrInvalidState = Error(C.OPUS_INVALID_STATE)
|
||||
ErrAllocFail = Error(C.OPUS_ALLOC_FAIL)
|
||||
)
|
||||
|
||||
// Error string (in human readable format) for libopus errors.
|
||||
func (e Error) Error() string {
|
||||
return fmt.Sprintf("opus: %s", C.GoString(C.opus_strerror(C.int(e))))
|
||||
}
|
Reference in New Issue
Block a user