tyiannak / pyAudioAnalysis

Python Audio Analysis Library: Feature Extraction, Classification, Segmentation and Applications
Apache License 2.0
5.83k stars 1.19k forks source link

Add headers to CSV output with feature names? #386

Open gregsadetsky opened 1 year ago

gregsadetsky commented 1 year ago

Hi! Congrats on the great package

I've been using python ./audioAnalysis.py featureExtractionDir to get the feature analysis of multiple audio files. It works great, but the output CSV files don't have a "header" i.e. a first line that lists the name of the features.

By exploring the code, I saw that the feature names get dropped on this line (the feature names are in the temporary variable _ which gets discarded)

By printing those feature names, I was able to see that the list of 136 features was zcr_mean, energy_mean, energy_entropy_mean, spectral_centroid_mean, ...

would there be interest in adding a header to the CSV output files? I'd be glad to open a PR.

also see these related issues which seem to stem from the CSV not having a header i.e. these issues would be addressed as well: #211 #159