def get_seeds(self, audio_filepath):
"""Get the seeds file to pass to the HLL tracker.
Parameters
----------
audio_filepath : str
Path to audio file.
Returns
-------
seeds_fpath : str
Path to the seeds output file.
"""
y, sr = librosa.load(audio_filepath, sr=44100)
y_harmonic = librosa.effects.harmonic(y)
cqt, samples, freqs = self._compute_cqt(y_harmonic, sr)
seeds = self._pick_seeds_cqt(cqt, freqs, samples)
seeds_fpath = tmp.mktemp('.csv')
with open(seeds_fpath, 'w') as fhandle:
writer = csv.writer(fhandle, delimiter=',')
writer.writerows(seeds)
return seeds_fpath
评论列表
文章目录