<commit_before>#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <SDL.h>

#include <list>
#include <vector>
#include <iostream>
#include <cstdlib>
#include <cstring>

#include "mixer.hxx"
#include "audio_source.hxx"

using namespace std;

#define BUFFER_SIZE 4096
SDL_AudioSpec Mixer::audioSpec = {
  AUDIO_SAMPLE_RATE, AUDIO_S16SYS, 2, 0, BUFFER_SIZE, 0 /* padding */,
  2*BUFFER_SIZE,
  &callback, NULL /* populate in constructor */
};

Mixer::Mixer() {
  //Set the userdata for the SDL Audio callback
  audioSpec.userdata = this;
  if (-1 == SDL_OpenAudio(&audioSpec, NULL)) {
    enabled = false;
    cerr << "WARN: Could not open audio device: "
         << SDL_GetError() << endl;
  } else {
    enabled = true;
    pause(false);
  }
}
<commit_msg>Reduce audio buffer size to 1024.<commit_after>#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <SDL.h>

#include <list>
#include <vector>
#include <iostream>
#include <cstdlib>
#include <cstring>

#include "mixer.hxx"
#include "audio_source.hxx"

using namespace std;

#define BUFFER_SIZE 1024
SDL_AudioSpec Mixer::audioSpec = {
  AUDIO_SAMPLE_RATE, AUDIO_S16SYS, 2, 0, BUFFER_SIZE, 0 /* padding */,
  2*BUFFER_SIZE,
  &callback, NULL /* populate in constructor */
};

Mixer::Mixer() {
  //Set the userdata for the SDL Audio callback
  audioSpec.userdata = this;
  if (-1 == SDL_OpenAudio(&audioSpec, NULL)) {
    enabled = false;
    cerr << "WARN: Could not open audio device: "
         << SDL_GetError() << endl;
  } else {
    enabled = true;
    pause(false);
  }
}

{'fraction_non_alphanumeric': 0.13795336787564766, 'fraction_numerical': 0.01683937823834197, 'mean_word_length': 3.967845659163987, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 17, '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': '5952997', 'n_tokens_mistral': 583, 'n_tokens_neox': 553, 'n_words': 149}