From 1fcff7e2c5f68d0c672e1610ac9290459387d80e Mon Sep 17 00:00:00 2001 From: Vin Date: Tue, 17 Dec 2013 22:12:21 +0000 Subject: [PATCH] Fixed some import/class mistakes --- dejavu/__init__.py | 6 +++--- dejavu/recognize.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dejavu/__init__.py b/dejavu/__init__.py index 33414f7..340db94 100755 --- a/dejavu/__init__.py +++ b/dejavu/__init__.py @@ -1,6 +1,6 @@ from dejavu.database import SQLDatabase from dejavu.convert import Converter -import dejavu.fingerprint as fingerprint +import fingerprint from scipy.io import wavfile from multiprocessing import Process import wave, os @@ -44,7 +44,7 @@ class Dejavu(): """ return [lst[i::n] for i in xrange(n)] - def fingerprint(self, path, output, extensions, nprocesses): + def do_fingerprint(self, path, output, extensions, nprocesses): # convert files, shuffle order files = self.converter.find_files(path, extensions) @@ -118,7 +118,7 @@ class Dejavu(): channels.append(frames[:, channel]) return (channels, Fs) - def fingerprint(self, filepath, song_name=None): + def fingerprint_file(self, filepath, song_name=None): # TODO: replace with something that handles all audio formats channels, Fs = self.extract_channels(path) if not song_name: diff --git a/dejavu/recognize.py b/dejavu/recognize.py index 024e62f..68700fd 100755 --- a/dejavu/recognize.py +++ b/dejavu/recognize.py @@ -32,7 +32,7 @@ class BaseRecognizer(object): class WaveFileRecognizer(BaseRecognizer): def __init__(self, dejavu, filename=None): - super(BaseRecognizer, self).__init__(dejavu) + super(WaveFileRecognizer, self).__init__(dejavu) self.filename = filename def recognize_file(self, filename): @@ -66,8 +66,8 @@ class MicrophoneRecognizer(BaseRecognizer): CHANNELS = 2 RATE = 44100 - def __init__(self, dejavu, seconds=None) - super(BaseRecognizer, self).__init__(dejavu) + def __init__(self, dejavu, seconds=None): + super(MicrophoneRecognizer, self).__init__(dejavu) self.audio = pyaudio.PyAudio() self.stream = None self.data = []