43def computeFeature(cFeatureName, x, f_s, afWindow=None, iBlockLength=4096, iHopLength=2048):
46 hFeatureFunc = getattr(pyACA,
"Feature" + cFeatureName)
49 x = ToolPreprocAudio(x)
54 afWindow = ToolComputeHann(iBlockLength)
56 assert(afWindow.shape[0] == iBlockLength),
"parameter error: invalid window dimension"
59 [X, f, t] = computeSpectrogram(x, f_s,
None, iBlockLength, iHopLength)
62 v = hFeatureFunc(X, f_s)
65 [v, t] = hFeatureFunc(x, iBlockLength, iHopLength, f_s)
93 [f_s, afAudioData] = ToolReadAudio(cPath)
100 [v, t] = computeFeature(cFeatureName, afAudioData, f_s,
None, iBlockLength, iHopLength)