<commit_before>import argparse
import alsaaudio as alsa
import json
import Queue
from threading import Thread
from connect_ffi import ffi, lib

RATE = 44100
CHANNELS = 2
PERIODSIZE = 64
SAMPLESIZE = 2 # 16 bit integer
MAXPERIODS = int(0.5 * RATE / PERIODSIZE) # 0.5s Buffer

audio_arg_parser = argparse.ArgumentParser(add_help=False)
audio_arg_parser.add_argument('--device', '-D', help='alsa output device', default='default')
audio_arg_parser.add_argument('--mixer', '-m', help='alsa mixer name for volume control', default=alsa.mixers()[0])
args = audio_arg_parser.parse_known_args()[0]

device = alsa.PCM(
        alsa.PCM_PLAYBACK,
        card = args.device)

device.setchannels(CHANNELS)
device.setrate(RATE)
device.setperiodsize(PERIODSIZE)
device.setformat(alsa.PCM_FORMAT_S16_LE)

mixer = alsa.Mixer(args.mixer)

def userdata_wrapper(f):
    def inner(*args):<commit_msg>Fix ALSA period size to be 0.25s<commit_after>import argparse
import alsaaudio as alsa
import json
import Queue
from threading import Thread
from connect_ffi import ffi, lib

RATE = 44100
CHANNELS = 2
PERIODSIZE = 44100 / 4 # 0.25s
SAMPLESIZE = 2 # 16 bit integer
MAXPERIODS = int(0.5 * RATE / PERIODSIZE) # 0.5s Buffer

audio_arg_parser = argparse.ArgumentParser(add_help=False)
audio_arg_parser.add_argument('--device', '-D', help='alsa output device', default='default')
audio_arg_parser.add_argument('--mixer', '-m', help='alsa mixer name for volume control', default=alsa.mixers()[0])
args = audio_arg_parser.parse_known_args()[0]

device = alsa.PCM(
        alsa.PCM_PLAYBACK,
        card = args.device)

device.setchannels(CHANNELS)
device.setrate(RATE)
device.setperiodsize(PERIODSIZE)
device.setformat(alsa.PCM_FORMAT_S16_LE)

mixer = alsa.Mixer(args.mixer)

def userdata_wrapper(f):
    def inner(*args):
{'fraction_non_alphanumeric': 0.11581291759465479, 'fraction_numerical': 0.026726057906458798, 'mean_word_length': 5.417857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3700816', 'n_tokens_mistral': 664, 'n_tokens_neox': 628, 'n_words': 147}