In [1]:
import sys
sys.path.insert(2, '../src/')
# project imports
import read_audio, fingerprinting, match, datastore
from scipy.io import wavfile
In [2]:
%load_ext autoreload
%autoreload 2
In [14]:
def get_match(fpath, dstore):
samples = read_audio.get_mono(fpath)
hashes = fingerprinting.get_fingerprints(samples)
# print len(list(match.get_matches_for_hashes(hashes, dstore)))
return match.get_match(hashes, dstore)
In [26]:
dstore = datastore.Datastore()
dstore.add_fingerprints('../D5/WhoopeeTiYiYo.wav')
dstore.add_fingerprints('../D4/MMw.wav')
dstore.add_fingerprints('../D4/Mpmm.wav')
dstore.add_fingerprints('../D4/mMbm.wav')
In [31]:
get_match('../D4/MMw.wav', dstore)
Out[31]:
In [33]:
get_match('../D4/mmsm.wav', dstore)
Out[33]:
In [34]:
!open ../D4/
In [5]:
%%timeit
dstore = datastore.Datastore()
dstore.add_fingerprints('../D5/WhoopeeTiYiYo.wav')
dstore.add_fingerprints('../D4/MMw.wav')
In [17]:
%%timeit
get_match('../D4/MMw.wav', dstore)
In [393]:
match.get_match(hashes, dstore)
Out[393]:
In [ ]:
match.