<commit_before>import os
import time
import recorder


def record_playing(**kwargs):
    """Record audio signal and save it."""
    save_dir = kwargs.get('save_dir', 'test/')
    basename = raw_input('Type a name for the file?')
    save_name = '{}_{}.wav'.format(basename, time.strftime("%Y%m%d"))
    save_name = os.path.join(save_dir, save_name)
    raw_input('Press enter when ready to start...')
    rec = recorder.AudioRecorder(max_length=60)
    rec.start_record(savename=save_name)


if __name__ == "__main__":
    record_playing()
<commit_msg>adding visualization option to recorder<commit_after>import os
import time

#  This project
import recorder
import check_signal

def record_playing(**kwargs):
    """Record audio signal and save it."""
    save_dir = kwargs.get('save_dir', 'test/')
    show_audio = kwargs.get('show_audio', False)
    basename = raw_input('Type a name for the file? ')
    save_name = '{}_{}.wav'.format(basename, time.strftime("%Y%m%d"))
    save_name = os.path.join(save_dir, save_name)
    raw_input('Press enter when ready to start...')
    rec = recorder.AudioRecorder(max_length=60)
    rec.start_record(savename=save_name)
    if show_audio:
        check_signal.audio_report(save_name)


if __name__ == "__main__":
    record_playing(show_audio=True)

{'fraction_non_alphanumeric': 0.1335907335907336, 'fraction_numerical': 0.003088803088803089, 'mean_word_length': 4.377593360995851, 'pattern_counts': {'":': 2, '<': 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': '3470952', 'n_tokens_mistral': 442, 'n_tokens_neox': 425, 'n_words': 100}