Commit graph

47 commits

Author SHA1 Message Date
worldveil
c90d14fdd6 Fix to dejavu.py script, small edits, removal of unecessary printing 2014-03-05 01:28:34 -05:00
worldveil
1e3dbe8eaf Formatting 2014-02-23 11:30:24 -05:00
worldveil
fec889db78 Merge branch 'patch-1' of https://github.com/suxianbaozi/dejavu 2014-02-23 11:29:29 -05:00
suxianbaozi
7cc178444e change the start of j val to 1
when j=0  ,i+j is alse equal to i,that will make so many same hashes from diffent songs
2014-02-21 15:29:46 +08:00
Bhuvanesh Kumar
ea748847ed fixed multiple issues to prevent refingerprinting songs in same dejavu instance
* fixed code to prevent refingerprinting song if it is already fingerprinted in fingerprint_file()
	* fixed code to prevent multiple fingerprinting of songs in same dejavu instance
2014-02-21 03:00:15 +05:30
Bhuvanesh Kumar
3fe99ac5c3 fixing fingerprinted column of songs table not getting updated to 1. 2014-02-21 01:13:42 +05:30
worldveil
eefcf0991c Corrected fingerprints table schema, fixes #26 2014-01-26 12:28:40 -05:00
Wessie
64a6161b90 Rewrote multiprocessing parts to only require one database connection
List of changes in detail:
- fingerprint_directory:
	Now uses mp.Pool.imap and updates database in callers
	process.
- fingerprint_file:
	Now uses _fingerprint_worker internally.
- _fingerprint_worker:
	Some slight changes to argument handling due to `imap`
	usage.

	Changed to return (song_name, hashes) where hashes is
	a set of hashes from all channels.
- path_to_songname:
	Changed to use `os.path.splitext`, this caused files with
	a period in their name to return the wrong name.
2014-01-20 20:53:25 +01:00
worldveil
cd7adc1485 Fixes #17 by adding configuration parameter for fingerprinting seconds, preserves this in FileRecognizer, and documents this in the README 2014-01-07 23:25:55 -05:00
worldveil
9eca3cc05a bugfixes and tweaks. also now returns offset of matched song 2013-12-25 02:56:43 -06:00
Wessie
7d14e0734a Switched fingerprint_directory to using multiprocessing.Pool
Fixed an issue of 'grouper' items being generators due to ifilter usage.
Temporary fix applied for the need of referencing SQLDatabase.FIELD_SONGNAME in __init__
Cleaned up some pep8 style issues
2013-12-23 14:59:08 +01:00
Wessie
e071804ea5 Fixed the issue of the default database not being imported.
Fixed a bug in the SQL database pertaining to the use of grouper.
Made SQLDatabase pickleable, for better multiprocessing support.
2013-12-21 12:01:05 +01:00
Wessie
f276efdf32 Cleaned up database.py
- Moved SQLDatabase to a SQL specific file
- Database class is now an abstract base class
- Cursor moved into SQL specific file
- Allowed for multi-database support in the future
2013-12-20 18:16:35 +01:00
Wessie
94c4cc0d95 Updated README for the changes to the interface.
Changed default value from None to 10 for the MicrophoneRecognizer.recognize
2013-12-19 01:34:04 +01:00
Wessie
292ddf029d Reversed expected variables to the correct position. 2013-12-19 01:22:27 +01:00
Wessie
29029238fc A fairly big batch of changes, blame me to forget committing
Changes in no particular order:
- Replaced all use cases of wavfile/wave and extract_channels with the new decoder.read function
- Added a 'recognize' method to the Dejavu class. This is a shortcut for recognizing songs.
- Renamed 'do_fingerprint' into 'fingerprint_directory'
- Removed parameters not required anymore from fingerprint_directory
- Cleaned up fingerprint.py
- Made fingerprint.generate_hashes a generator
- WaveFileRecognizer is now FileRecognizer and can take any formats supported by pydub
- Fixed MicrophoneRecognizer to actually run, previous version had many small mistakes
- Renamed 'fingerprint_worker' to '_fingerprint_worker' to signify it is not to be used publicly
- Moved 'chunkify' outside the Dejavu class
- Cleaned up pep8 styling mistakes in all edited files.
2013-12-19 00:54:17 +01:00
Wessie
7895bae23e Fixed any references to old converter to use the new functions.
- Reversed return values in decode.read
2013-12-18 18:15:57 +01:00
Wessie
8a7358d426 Added the fix for issue #13 in the original repository. 2013-12-18 18:11:23 +01:00
Wessie
7122e110d1 Cleaned up convert.py and renamed it to decode.py
- 'Converter' class removed
- 'ensure_folder' removed
- 'find_files' changed into a generator and made it work with spaces
- 'convert' renamed into 'read'
- 'convert' now handles any supported file by pydub
- 'convert' now returns the data instead of saving it to a file (same format as 'extract_channels')
- generic cleanup of formatting in the file
2013-12-18 18:02:07 +01:00
worldveil
48d7e8ecee small fixes to pguridi PR 2013-12-18 00:31:00 -06:00
Pedro Guridi
880af4a5b9 fixes #15, adds handling for KeyboardInterrupt. added some handling for #4, now skips file not sampled at 44100hz 2013-12-18 00:38:27 -03:00
Pedro Guridi
907637a633 fixes #9, now works well with spaces in filenames 2013-12-17 20:33:40 -03:00
Wessie
3b72768f94 Fixed various small things that weren't caught before.
- Fixes SQL queries for table creations
- Table creation is now down in reverse order to accompany the foreign key
- Fixed a typo in the BaseRecognizer that caused it to not work
- Changed configuration passed to Dejavu into a (nested) dictionary
2013-12-18 00:31:57 +01:00
Pedro Guridi
f3bdc34994 adds a config option to limit the input seconds for fingerprinting. 2013-12-17 20:21:59 -03:00
Pedro Guridi
6a4d386736 fixes #3, now song_name column in database has the full path 2013-12-17 19:54:04 -03:00
Pedro Guridi
0b36781ccd fixes #4, now wav files storage is optional 2013-12-17 19:42:39 -03:00
Wessie
1c9eddc3a2 Merged with fingerprinter and recognizer cleanup 2013-12-17 23:19:45 +01:00
Vin
1fcff7e2c5 Fixed some import/class mistakes 2013-12-17 22:12:21 +00:00
Vin
614ad0d4cc Moved mic recording constants inside MicrophoneRecognizer 2013-12-17 22:05:09 +00:00
Vin
788b3acebf Added missing 'self' 2013-12-17 22:03:50 +00:00
Vin
d25c564d4f Finished the changes to the recognize module
- Recognizers now use a class structure
 - Generic code for matching is in BaseRecognizer
 - Two recognizers are available:
  - Wave file recognizer
  - Recording recognizer
2013-12-17 21:57:59 +00:00
Wessie
05adf3bc31 Changed default cursor type for mysql from DictCursor to Cursor. 2013-12-17 22:02:59 +01:00
Vin
371742a314 Began moving recognizer functionality into separate classes 2013-12-17 20:55:20 +00:00
Wessie
6f4cadafbb Added a foreign key relationship to the create table statements.
- MySQL will also use the InnoDB engine now.
- Added a ping call in the MySQL Cursor cache mechanism
- Added a rollback call when a MySQLError occurs
- Removed 'delete_orphans' which is not needed anymore due to foreign key constraints and delete on cascade
- Changed SQLDatabase to accept options to create a cursor factory, instead of taking a pre-created cursor factory
2013-12-17 21:55:05 +01:00
Vin
f02ab94192 Cleaned up Dejavu class calls (find_matches, align_matches) 2013-12-17 20:18:55 +00:00
Vin
25bf97e813 Changed a method to fit the new hash tuples 2013-12-17 16:37:06 +00:00
Vin
776995e454 Merge remote-tracking branch 'wessie/master' 2013-12-17 01:14:13 +00:00
Wessie
bed11f3de7 Switched back to MySQLdb for better support of executemany. 2013-12-17 02:00:05 +01:00
Vin
ab2cf9d58b Changed insert_hashes to fit the new data format 2013-12-17 01:57:18 +01:00
Vin
3bc507d8e4 Changed insert_hashes to fit the new data format 2013-12-17 00:48:49 +00:00
Vin
9faf2cd591 Merge remote-tracking branch 'wessie/master' 2013-12-17 00:46:17 +00:00
Wessie
0bd7219b87 Cleaned up the database driver.
- The SQLDatabase class now uses a context manager for mysql access.
- Most of the error handling is done by the context manager now
- Optimized several methods that returned a list into returning a generator
- Optimized return_matches to use an IN query instead.
- Other small fixes.
2013-12-17 01:39:03 +01:00
Vin
a4ed612658 Moved main Dejavu class from dejavu.control to dejavu 2013-12-16 23:38:58 +00:00
Vin
6a6ae94e3d Refactored the fingerprint module 2013-12-16 23:12:50 +00:00
worldveil
9aa80ff87c added MIT license fixes #5, also fixes #6 2013-12-16 10:28:22 -06:00
worldveil
51680735db fixes #1 and fixes #2. also identifies issue with DELETE_ORPHANS sql command 2013-11-29 22:08:25 -05:00
worldveil
90a93bc47b moved to github 2013-11-18 21:51:27 -05:00