mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +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.
|
// decode accepts an ogg stream and returns a decorded stream.
|
||||||
// The decorded format is 1 or 2-channel interleaved littleendian int16 values.
|
// The decorded format is 1 or 2-channel interleaved littleendian int16 values.
|
||||||
func decode(in io.Reader) ([]byte, int, int, error) {
|
func decode(in io.ReadCloser) ([]byte, int, int, error) {
|
||||||
// TODO: in should be io.ReadCloser
|
|
||||||
|
|
||||||
mem, err := ioutil.ReadAll(in)
|
mem, err := ioutil.ReadAll(in)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, 0, 0, err
|
return nil, 0, 0, err
|
||||||
}
|
}
|
||||||
|
if err := in.Close(); err != nil {
|
||||||
|
return nil, 0, 0, err
|
||||||
|
}
|
||||||
channelNum := C.int(0)
|
channelNum := C.int(0)
|
||||||
sampleRate := C.int(0)
|
sampleRate := C.int(0)
|
||||||
output := (*C.short)(nil)
|
output := (*C.short)(nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user