audiocogs / flac.js

FLAC decoder in JavaScript

Home Page:http://audiocogs.org/codecs/flac/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

8bps sound not being correctly decoded

satazor opened this issue · comments

I've tried to play a 8bps flac sound and the sounds is really strange.

I managed to identify the issue, bellow are the changes that I had to do:

var output = new ArrayBuffer(this.blockSize * channels * (is32 ? 32 : 16) / 8)

I've also removed the << sampleShift instructions. You can also set sampleShift = 0 to test it out.

I'm I missing something here? Placing 8bits integer into 16bits does not require shifting. Is this related to big/little endian?

Yup, you are right. Sorry this is almost a year later (oops). Should be fixed by aa47cb9 and deb2f39. Also fixes 24 bit (non LPC) files - see #15. Not sure what the sampleShift thing was, but I removed it. An artifact from the port of libav, which has that. Still not sure why, but it's better without it so yay. 😄