dist/wavefile.js
function decodeBlock(block) {
  decoderPredicted_ = sign_((block[1] << 8) | block[0]);
  decoderIndex_ = block[2];
  decoderStep_ = STEP_TABLE[decoderIndex_];
  /** @type {!Array<number>} */
  let result = [
      decoderPredicted_,
      sign_((block[3] << 8) | block[2])
    ];
  for (let i=4; i<block.length; i++) {
    /** @type {number} */
    let original_sample = block[i];
    /** @type {number} */
    let second_sample = original_sample >> 4;
    /** @type {number} */
    let first_sample = (second_sample << 4) ^ original_sample;
    result.push(decodeSample_(first_sample));
    result.push(decodeSample_(second_sample));
  }
  return result;
}
function decodeBlock(block) {
  decoderPredicted_ = sign_((block[1] << 8) | block[0]);
  decoderIndex_ = block[2];
  decoderStep_ = STEP_TABLE[decoderIndex_];
  /** @type {!Array<number>} */
  let result = [
      decoderPredicted_,
      sign_((block[3] << 8) | block[2])
    ];
  for (let i=4; i<block.length; i++) {
    /** @type {number} */
    let original_sample = block[i];
    /** @type {number} */
    let second_sample = original_sample >> 4;
    /** @type {number} */
    let first_sample = (second_sample << 4) ^ original_sample;
    result.push(decodeSample_(first_sample));
    result.push(decodeSample_(second_sample));
  }
  return result;
}
function decodeBlock ( block ) { decoderPredicted_ = sign_ ( ( block [ 1 ] << 8 ) | block [ 0 ] ) ; decoderIndex_ = block [ 2 ] ; decoderStep_ = STEP_TABLE [ decoderIndex_ ] ; /** @type {!Array<number>} */ let result = [ decoderPredicted_ , sign_ ( ( block [ 3 ] << 8 ) | block [ 2 ] ) ] ; for ( let i = 4 ; i < block . length ; i ++ ) { /** @type {number} */ let original_sample = block [ i ] ; /** @type {number} */ let second_sample = original_sample >> 4 ; /** @type {number} */ let first_sample = ( second_sample << 4 ) ^ original_sample ; result . push ( decodeSample_ ( first_sample ) ) ; result . push ( decodeSample_ ( second_sample ) ) ; } return result ; }
Decode a block of ADPCM samples into 16-bit PCM samples.
@param {!Array<number>} block A adpcm sample block.
@return {!Array<number>}
Decode a block of ADPCM samples into 16 - bit PCM samples .