Search code examples
pythonmachine-learningaudiofeature-extraction

import error when using spafe library for feature extraction


I ' am working on audio file and need to use spafe library for lfcc, lpc... and i install the library as mentionned in the site : https://spafe.readthedocs.io/en/latest/

But when i try to extract some features , like lfcc, mfcc, lpc, i have import error par example when i use this code :

import scipy.io.wavfile

import spafe.utils.vis as vis

from spafe.features.mfcc import lfcc

i have this error :

ImportError: cannot import name 'lfcc'

I don't undestand because i can import spafe, i have all dependancies the libraries required with the correct versions ( numpy, scipy...).


Solution

  • There seems to be a typo in the docs example (which I guess tou are trying to follow); it should be

    from spafe.features.lfcc import lfcc
    

    i.e. lfcc, not mfcc (which mfcc indeed does not have a module lfcc, hence the error).