<commit_before>define(function() {

  'use strict';
  
  var DELTAS = new Int8Array([0, -49, -36, -25, -16, -9, -4, -1, 0, 1, 4, 9, 16, 25, 36, 49]);

  function open(item) {
    return item.getBytes().then(function(bytes) {
      var samples = new Uint8Array(2 * (bytes.length - 20));
      var value = 128;
      for (var i = 0; i < samples.length; i++) {
        var index = 20 + i >> 1;
        value += (i % 2) ? DELTAS[bytes[index] >> 4] : DELTAS[bytes[index] & 0xf];
        value |= 0;
        samples[i] = value & 0xff; // (value << 24 >> 24) + 128;
      }
      item.setRawAudio({
        channels: 1,
        samplingRate: 11000,
        bytesPerSample: 1,
        samples: samples,
      });
    });
  }
  
  return open;

});<commit_msg>Try normalizing rolling value as byte instead<commit_after>define(function() {

  'use strict';
  
  var DELTAS = new Int8Array([0, -49, -36, -25, -16, -9, -4, -1, 0, 1, 4, 9, 16, 25, 36, 49]);

  function open(item) {
    return item.getBytes().then(function(bytes) {
      var samples = new Uint8Array(2 * (bytes.length - 20));
      var value = 0x80;
      for (var i = 0; i < samples.length; i++) {
        var index = 20 + i >> 1;
        value += (i % 2) ? DELTAS[bytes[index] >> 4] : DELTAS[bytes[index] & 0xf];
        value &= 0xff;
        samples[i] = value; // (value << 24 >> 24) + 128;
      }
      item.setRawAudio({
        channels: 1,
        samplingRate: 11000,
        bytesPerSample: 1,
        samples: samples,
      });
    });
  }
  
  return open;

});
{'fraction_non_alphanumeric': 0.17570215545395165, 'fraction_numerical': 0.07119529719137818, 'mean_word_length': 2.070140280561122, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1849128', 'n_tokens_mistral': 646, 'n_tokens_neox': 551, 'n_words': 153}