mirror of
https://github.com/correl/dejavu.git
synced 2024-11-23 19:19:53 +00:00
parent
62cf1f6f89
commit
9aa80ff87c
4 changed files with 17 additions and 5 deletions
9
LICENSE.md
Normal file
9
LICENSE.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
### MIT License
|
||||
|
||||
Copyright (c) 2013 Will Drevo
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -233,7 +233,7 @@ class SQLDatabase():
|
|||
return self.cursor.fetchone()
|
||||
except mysql.Error, e:
|
||||
print "Error in get_songs(), %d: %s" % (e.args[0], e.args[1])
|
||||
return None
|
||||
return None
|
||||
|
||||
|
||||
def insert(self, key, value):
|
||||
|
|
|
@ -202,8 +202,9 @@ class Fingerprinter():
|
|||
|
||||
# extract idenfication
|
||||
song = self.db.get_song_by_id(song_id)
|
||||
songname = song.get(SQLDatabase.FIELD_SONGNAME, None)
|
||||
if not songname:
|
||||
if song:
|
||||
songname = song.get(SQLDatabase.FIELD_SONGNAME, None)
|
||||
else:
|
||||
return None
|
||||
songname = songname.replace("_", " ")
|
||||
elapsed = time.time() - starttime
|
||||
|
|
6
go.py
6
go.py
|
@ -15,6 +15,8 @@ dejavu.fingerprint("va_us_top_40/mp3", "va_us_top_40/wav", [".mp3"], 5)
|
|||
from dejavu.recognize import Recognizer
|
||||
recognizer = Recognizer(dejavu.fingerprinter, config)
|
||||
|
||||
song = recognizer.read("va_us_top_40/wav/17_-_#Beautiful_-_Mariah_Carey_ft.wav")
|
||||
|
||||
# recognize song playing over microphone for 10 seconds
|
||||
song = recognizer.listen(seconds=1, verbose=True)
|
||||
print song
|
||||
#song = recognizer.listen(seconds=1, verbose=True)
|
||||
#print song
|
Loading…
Reference in a new issue