parser = argparse.ArgumentParser(formatter_class=RawTextHelpFormatter) parser.add_argument('-f', '--file', nargs='?') args = parser.parse_args() if not args.file: parser.print_help() sys.exit(0) def grouper(iterable, n, fillvalue=None): args = [iter(iterable)] * n return (filter(None, values) for values in izip_longest(fillvalue=fillvalue, *args)) r = FileReader(args.file) song = r.recognize() print(song) data = song["channels"] msg = ' * recorded %d samples' print colored(msg, attrs=['dark']) % len(data[0]) # reader.save_recorded('test.wav') Fs = fingerprint.DEFAULT_FS channel_amount = len(data) result = set() matches = []
from libs.reader_file import FileReader song = None seconds = 5 r = FileReader(123) r.recognize(seconds=seconds) print(song)