pyAudioAnalysis
pyAudioAnalysis copied to clipboard
ValueError: cannot reshape array of size 4800 into shape (240,10)
Hello,
The code didn't work when I using
F = audioFeatureExtraction.stFeatureExtraction(x, Fs, 0.050Fs, 0.025Fs);
which says
Traceback (most recent call last):
File "
Could you give me any suggestion to solve it? Thanks for your time.
The code works when I use F = audioFeatureExtraction.stFeatureExtraction(x[:, 0], Fs, 0.050Fs, 0.025Fs)
It seems that the audio with two channels is not work. What should I do, any examples for this kind of audio?
Thanks
These functions are designed for single channel audio signals. I am not sure if extracting a feature for multiple channels does even exist. You can merge the audio first, by for example averaging the channels or extract the features for each channel. It depends on the meaning of the channels. That is if they are captured by multiple microphones for example.
Yup. Apparently taking the mean of the two channels works. @scut-salmon
you can use two channels .wav file
audioBasicIO.stereo_to_mono(signal) does the averaging. See https://github.com/tyiannak/pyAudioAnalysis/blob/master/pyAudioAnalysis/MidTermFeatures.py#L328-L329