Feature Extractor
You can use FeatureExtractor for batch feature extraction
1# Get a 880Hz's audio file
2import audioflux as af
3from audioflux.type import SpectralFilterBankScaleType
4sample_path = af.utils.sample_path('880')
5audio_arr, sr = af.read(sample_path)
6
7# Create FeatureExtractor object and extract spectrogram
8fa_obj = af.FeatureExtractor(transforms=['bft', 'cwt', 'cqt'], samplate=sr, radix2_exp=12,
9 scale_type=SpectralFilterBankScaleType.OCTAVE)
10spec_result = fa_obj.spectrogram(audio_arr, is_continue=True)
11
12#Extract spectral/xxcc/deconv
13spectral_result = fa_obj.spectral(spec_result, spectral='flux',
14 spectral_kw={'is_positive': True})
15xxcc_result = fa_obj.xxcc(spec_result, cc_num=13)
16deconv_result = fa_obj.deconv(spec_result)