Skip to content

Commit

Permalink
Merge pull request #84 from hyperturtle/patch-1
Browse files Browse the repository at this point in the history
Update decode.go
  • Loading branch information
dusk125 committed Aug 31, 2021
2 parents 7a44c0d + f819e08 commit b1fa209
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wav/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ func Decode(r io.Reader) (s beep.StreamSeekCloser, format beep.Format, err error
if err := binary.Read(r, binary.LittleEndian, &fs); err != nil {
return nil, beep.Format{}, errors.Wrap(err, "wav: missing unknown chunk size")
}
if fs % 2 != 0 {
fs = fs + 1
}
trash := make([]byte, fs)
if err := binary.Read(r, binary.LittleEndian, trash); err != nil {
return nil, beep.Format{}, errors.Wrap(err, "wav: missing unknown chunk body")
Expand Down

0 comments on commit b1fa209

Please sign in to comment.