pyACA: Documentation 0.3.1
Source Code for Audio Content Analysis
Loading...
Searching...
No Matches
Functions
pyACA.getFeatureList Namespace Reference

Functions

 getFeatureList (feature_type='all')
 returns a list of available features by checking for all the Feature*.py files present in the package
 

Function Documentation

◆ getFeatureList()

getFeatureList ( feature_type = 'all')

returns a list of available features by checking for all the Feature*.py files present in the package

Parameters
feature_type(optional) type of features (valid values: 'all', 'spectral' 'temporal')
Returns
features: list of strings

Definition at line 14 of file getFeatureList.py.

14def getFeatureList(feature_type ='all'):
15
16 feature_type = feature_type.lower()
17 if feature_type == 'all':
18 feature_type = ''
19 elif feature_type == 'spectral':
20 feature_type = 'Spectral'
21 elif feature_type == 'temporal':
22 feature_type = 'Time'
23 else:
24 print('Invalid feature type')
25 return []
26
27 package_loc = os.path.dirname(pyACA.__file__)
28 modules = sorted(glob.glob(os.path.join(package_loc, 'Feature' + feature_type + '*.py')))
29 features = [os.path.basename(feature)[len('Feature'):-len('.py')] for feature in modules]
30 return features