mirror of
https://github.com/correl/dejavu.git
synced 2024-11-23 19:19:53 +00:00
Fix to dejavu.py script, small edits, removal of unecessary printing
This commit is contained in:
parent
2e6d030655
commit
c90d14fdd6
3 changed files with 4 additions and 5 deletions
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
## Dependency installation for Mac OS X
|
## Dependency installation for Mac OS X
|
||||||
|
|
||||||
Tested on OS X Mavericks. Needs [Homebrew](http://brew.sh) to be installed.
|
Tested on OS X Mavericks. An option is to install [Homebrew](http://brew.sh) and do the following:
|
||||||
|
|
||||||
```
|
```
|
||||||
brew install portaudio
|
brew install portaudio
|
||||||
|
@ -27,3 +27,5 @@ sudo pip install MySQL-python
|
||||||
|
|
||||||
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
|
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
|
||||||
```
|
```
|
||||||
|
|
||||||
|
However installing `portaudio` and/or `ffmpeg` from source is also doable.
|
|
@ -72,6 +72,7 @@ if command == 'fingerprint': # Fingerprint all files in a directory
|
||||||
elif command == 'recognize': # Recognize audio
|
elif command == 'recognize': # Recognize audio
|
||||||
|
|
||||||
source = sys.argv[2]
|
source = sys.argv[2]
|
||||||
|
song = None
|
||||||
|
|
||||||
if source in ['mic', 'microphone']:
|
if source in ['mic', 'microphone']:
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ class Dejavu(object):
|
||||||
for song in self.songs:
|
for song in self.songs:
|
||||||
song_name = song[self.db.FIELD_SONGNAME]
|
song_name = song[self.db.FIELD_SONGNAME]
|
||||||
self.songnames_set.add(song_name)
|
self.songnames_set.add(song_name)
|
||||||
print "Added: %s to the set of fingerprinted songs..." % song_name
|
|
||||||
|
|
||||||
def fingerprint_directory(self, path, extensions, nprocesses=None):
|
def fingerprint_directory(self, path, extensions, nprocesses=None):
|
||||||
# Try to use the maximum amount of processes if not given.
|
# Try to use the maximum amount of processes if not given.
|
||||||
|
@ -134,9 +133,6 @@ class Dejavu(object):
|
||||||
largest_count = diff_counter[diff][sid]
|
largest_count = diff_counter[diff][sid]
|
||||||
song_id = sid
|
song_id = sid
|
||||||
|
|
||||||
print("Diff is %d with %d offset-aligned matches" % (largest,
|
|
||||||
largest_count))
|
|
||||||
|
|
||||||
# extract idenfication
|
# extract idenfication
|
||||||
song = self.db.get_song_by_id(song_id)
|
song = self.db.get_song_by_id(song_id)
|
||||||
if song:
|
if song:
|
||||||
|
|
Loading…
Reference in a new issue