diff --git a/codec/adpcm/adpcm.js b/cmd/audio-player/adpcm.js similarity index 91% rename from codec/adpcm/adpcm.js rename to cmd/audio-player/adpcm.js index 2637fff5..c1362938 100644 --- a/codec/adpcm/adpcm.js +++ b/cmd/audio-player/adpcm.js @@ -30,6 +30,10 @@ let est, // Estimation of sample based on quantised ADPCM nibble. idx, // Index to step used for estimation. step; +function decodeSample(nibble) { + return new Uint8Array([1, 2]) +} + function decode(b) { // b should be a Uint8Array if (!(b instanceof Uint8Array)) { @@ -49,15 +53,15 @@ function decode(b) { var nib2 = twoNibs >> 4; var nib1 = (nib2 << 4) ^ twoNibs var firstBytes = decodeSample(nib1) - concat(result, firstBytes) + result = concat(result, firstBytes) var secondBytes = decodeSample(nib2) - concat(result, secondBytes) + result = concat(result, secondBytes) } if (b[3] == 1) { var padNib = b[b.length - 1] var samp = decodeSample(padNib) - concat(result, samp) + result = concat(result, samp) } return result; diff --git a/cmd/audio-player/index.html b/cmd/audio-player/index.html index d8e7aa23..d4015ab4 100644 --- a/cmd/audio-player/index.html +++ b/cmd/audio-player/index.html @@ -5,6 +5,7 @@