Python Scipy Fft Wav Files

Perform FFT for every second on wav file with Python

What you are looking can be accomplished in a single lane, by using the standard command for the STFT

I need to FFT wav files?

Your error message states that you are trying to iterate over an integer (a). When you define a via

a = data.T[0]

you grab the first value of data.T. Since your data files are single channel, you are taking the first value of the first channel (an integer). Changing this to

a = data.T

will fix your problem.

WAV FFT: Slice indices must be integers

abs() doesn't make your number into an integer. It just turns negative numbers into positive numbers. When len(c) is an odd number your variable d is a float that ends in x.5.

What you want is probably round(d) instead of abs(d)



Related Topics



Leave a reply



Submit