forked from SRKaren/PS
/
finger.py
executable file
·41 lines (36 loc) · 961 Bytes
/
finger.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from dejavu import Dejavu
from dejavu.testing import*
from dejavu.recognize import FileRecognizer
import warnings
import json
import os, fnmatch
import argparse
import sys
warnings.filterwarnings("ignore")
# load config from a JSON file (or anything outputting a python dictionary)
#with open("dejavu.cnf.SAMPLE") as f:
#Directorio de firmas
audiopath= "/home/nego/Descargas/firma"
extension= ".mp3"
audio_paths = get_files_recursive(audiopath, extension)
#Obtener longitud de pistas
for path in audio_paths:
print "Path %s" % path
n = get_length_audio(path, extension)
print "Length %s "%(n)
config={
"database": {
"host": "127.0.0.1",
"user": "root",
"passwd": "ksilva",
"db": "dejavu3"
},
"fingerprint_limit": [n]
}
# create a Dejavu instance
djv = Dejavu(config)
djv.fingerprint_file(path)
#djv.fingerprint_directory(audiopath, [extension])
#Comandos
#print len(sys.argv)
#print str(sys.arv)