mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
vorbis: Bug fix: Length returned wrong result with monoral source (#570)
This commit is contained in:
parent
f1f0277deb
commit
a31874ed48
@ -161,8 +161,11 @@ func decode(in audio.ReadSeekCloser) (*decoded, int, int, error) {
|
||||
return nil, 0, 0, err
|
||||
}
|
||||
d := &decoded{
|
||||
data: make([]float32, r.Length()*2),
|
||||
totalBytes: int(r.Length()) * 4, // TODO: What if length is 0?
|
||||
data: make([]float32, int(r.Length())*r.Channels()),
|
||||
|
||||
// TODO: r.Length() returns 0 when the format is unknown.
|
||||
// Should we check that?
|
||||
totalBytes: int(r.Length()) * r.Channels() * 2, // 2 means 16bit per sample.
|
||||
posInBytes: 0,
|
||||
source: in,
|
||||
decoder: r,
|
||||
|
Loading…
Reference in New Issue
Block a user