コード例 #1
0
    def testRegressionStreaming(self):
        #  In Streaming mode the duration of the file is not known by the algorithm so it works by concatenating fragments.
        #  About 30 seconds of processing are required to show results consistant with the Standard mode.

        loader = es.MonoLoader(filename=join(testdata.audio_dir, 'recorded', 'mozart_c_major_30sec.wav'))
        cp = es.Chromaprinter(analysisTime=30, concatenate=True)
        pool = Pool()

        loader.audio >> cp.signal
        cp.fingerprint >> (pool, 'chromaprint')

        es.essentia.run(loader)
        self.assertEqualVector(self.expected, pool['chromaprint'][0])
コード例 #2
0
ファイル: features.py プロジェクト: ctralie/acoss
    def chromaprint(self, analysisTime=30):
        """
        This algorithm computes the fingerprint of the input signal using Chromaprint algorithm. 
        It is a wrapper of the Chromaprint library

        Returns: The chromaprints are returned as base64-encoded strings.
        """
        vec_input = ess.VectorInput(self.audio_vector)
        chromaprinter = ess.Chromaprinter(analysisTime=analysisTime, sampleRate=self.fs)
        pool = Pool()

        vec_input.data >> chromaprinter.signal
        chromaprinter.fingerprint >> (pool, 'chromaprint')
        run(vec_input)
        return pool['chromaprint']
コード例 #3
0
import essentia.standard as es
import essentia.streaming as ess



import matplotlib.pyplot as plt


loader = ess.MonoLoader(filename = '/home/lib/audio/work/arglaaa-mini/22.wav')
fps = ess.Chromaprinter(analysisTime=20, concatenate=True)
pool = ess.essentia.Pool()

# Conecting the algorithms
loader.audio >> fps.signal
fps.fingerprint >> (pool, 'chromaprint')

ess.essentia.run(loader)

fp = pool['chromaprint'][0]

print(('fp = {0}'.format(fp)))

import acoustid as ai
# import acoustid.chromaprint
import codecs
import numpy as np

print('type(fp) = ', type(fp))
fpbytes = bytes(fp,  'utf-8')
print('fpbytes = {0}'.format(fpbytes))
fp_int = ai.chromaprint.decode_fingerprint(fpbytes)[0]