api.go | 3 +-- diff --git a/api.go b/api.go index 9cd149bac911c37bd947273913a54cf78e1c4b8d..ea86a5286cf67ebe337082dac109ab565fa424af 100644 --- a/api.go +++ b/api.go @@ -99,7 +99,6 @@ return dec, nil } func (dec *Decoder) DecodeFloat32(data []byte) ([]float32, error) { - var errno int // I don't know how big this frame will be, but this is the limit pcm := make([]float32, xMAX_FRAME_SIZE_MS*dec.sample_rate/1000) n := int(C.opus_decode_float( @@ -110,7 +109,7 @@ (*C.float)(&pcm[0]), C.int(cap(pcm)), 0)) if n < 0 { - return nil, opuserr(errno) + return nil, opuserr(n) } return pcm[:n], nil }