dist/wavefile.js
function decode(adpcmSamples, blockAlign=256) {
  /** @type {!Int16Array} */
  let samples = new Int16Array(adpcmSamples.length * 2);
  /** @type {!Array<number>} */
  let block = [];
  /** @type {number} */
  let fileIndex = 0;
  for (let i=0; i<adpcmSamples.length; i++) {
    if (i % blockAlign == 0 && i != 0) {            
      samples.set(decodeBlock(block), fileIndex);
      fileIndex += blockAlign * 2;
      block = [];
    }
    block.push(adpcmSamples[i]);
  }
  return samples;
}
function decode(adpcmSamples, blockAlign=256) {
  /** @type {!Int16Array} */
  let samples = new Int16Array(adpcmSamples.length * 2);
  /** @type {!Array<number>} */
  let block = [];
  /** @type {number} */
  let fileIndex = 0;
  for (let i=0; i<adpcmSamples.length; i++) {
    if (i % blockAlign == 0 && i != 0) {            
      samples.set(decodeBlock(block), fileIndex);
      fileIndex += blockAlign * 2;
      block = [];
    }
    block.push(adpcmSamples[i]);
  }
  return samples;
}
function decode ( adpcmSamples , blockAlign = 256 ) { /** @type {!Int16Array} */ let samples = new Int16Array ( adpcmSamples . length * 2 ) ; /** @type {!Array<number>} */ let block = [ ] ; /** @type {number} */ let fileIndex = 0 ; for ( let i = 0 ; i < adpcmSamples . length ; i ++ ) { if ( i % blockAlign == 0 && i != 0 ) { samples . set ( decodeBlock ( block ) , fileIndex ) ; fileIndex += blockAlign * 2 ; block = [ ] ; } block . push ( adpcmSamples [ i ] ) ; } return samples ; }
Decode IMA ADPCM samples into 16-bit PCM samples.
@param {!Uint8Array} adpcmSamples A array of ADPCM samples.
@param {number} blockAlign The block size.
@return {!Int16Array}
Decode IMA ADPCM samples into 16 - bit PCM samples .