<commit_before>#include "wav_extracting_agent.hh"

std::string WAV_extracting_agent::extract() const {
  std::string msg;
  std::vector<bool> msg_bits;

  int num_samples = inwav.get_num_samples();
  for (int i = 0; i < num_samples; ++i) {
    bool bit = extract_bit_from_sample(i);
    msg_bits.push_back(bit);
    if (is_last_byte_terminate(msg_bits)) {
      msg_bits.pop_back();
      return bits_to_string(msg_bits);
    }
  }
  return msg;
}

bool WAV_extracting_agent::extract_bit_from_sample(int index) const {
  int sample = inwav.get_sample(index);
  int bit = sample & 0x1;
  return bit == 0x1;
}
<commit_msg>Fixed bug where extract from wav returned empty string<commit_after>#include "wav_extracting_agent.hh"

std::string WAV_extracting_agent::extract() const {
  std::string msg;
  std::vector<bool> msg_bits;

  int num_samples = inwav.get_num_samples();
  for (int i = 0; i < num_samples; ++i) {
    bool bit = extract_bit_from_sample(i);
    msg_bits.push_back(bit);
    if (is_last_byte_terminate(msg_bits)) {
      msg_bits.pop_back();
      return bits_to_string(msg_bits);
    }
  }
  return bits_to_string(msg_bits);
}

bool WAV_extracting_agent::extract_bit_from_sample(int index) const {
  int sample = inwav.get_sample(index);
  int bit = sample & 0x1;
  return bit == 0x1;
}

{'fraction_non_alphanumeric': 0.11981566820276497, 'fraction_numerical': 0.007680491551459293, 'mean_word_length': 4.4978902953586495, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '4218821', 'n_tokens_mistral': 498, 'n_tokens_neox': 489, 'n_words': 96}