Fixed some import/class mistakes

This commit is contained in:
Vin 2013-12-17 22:12:21 +00:00
parent 614ad0d4cc
commit 1fcff7e2c5
2 changed files with 6 additions and 6 deletions

View file

@ -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:

View file

@ -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 = []