mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
audio/vorbis: decode should accept io.ReadCloser
This commit is contained in:
parent
f73b679fe6
commit
d5ac3f831d
@ -5548,13 +5548,14 @@ func cFloatsToSlice(p *C.float, n int) []float32 {
|
||||
|
||||
// decode accepts an ogg stream and returns a decorded stream.
|
||||
// The decorded format is 1 or 2-channel interleaved littleendian int16 values.
|
||||
func decode(in io.Reader) ([]byte, int, int, error) {
|
||||
// TODO: in should be io.ReadCloser
|
||||
|
||||
func decode(in io.ReadCloser) ([]byte, int, int, error) {
|
||||
mem, err := ioutil.ReadAll(in)
|
||||
if err != nil {
|
||||
return nil, 0, 0, err
|
||||
}
|
||||
if err := in.Close(); err != nil {
|
||||
return nil, 0, 0, err
|
||||
}
|
||||
channelNum := C.int(0)
|
||||
sampleRate := C.int(0)
|
||||
output := (*C.short)(nil)
|
||||
|
Loading…
Reference in New Issue
Block a user