1
import numpy as np
import librosa, librosa.display
import matplotlib.pyplot as plt

# MFCCs
# extract 13 MFCCs
MFCCs = librosa.feature.mfcc(signal, sample_rate, n_fft=n_fft, hop_length=hop_length, n_mfcc=13)

# display MFCCs
plt.figure(figsize=FIG_SIZE)
librosa.display.specshow(MFCCs, sr=sample_rate, hop_length=hop_length)
plt.xlabel("Time")
plt.ylabel("MFCC coefficients")
plt.colorbar()
plt.title("MFCCs")

plt.show()

this my code, I got a

FutureWarning: Pass y=[-0.01908943 -0.02839599 -0.02552439 ... -0.01526119 -0.01452393
 -0.01500733], sr=22050 as keyword args. From version 0.10 passing these as positional arguments will result in an error
  MFCCs = librosa.feature.mfcc(signal, sample_rate, n_fft=n_fft, hop_length=hop_length, n_mfcc=13)

I don't know how to fix it! I uninstall librosa and then install librosa again, but it doesn't work.plz, help me.

1 Answers1

4

I ran into the same warning when creating melspectrogram, and after a little searching, I found the solution for me.

I don't quite understand how it works, but if write:

MFCCs = librosa.feature.mfcc(y=signal, sr=sample_rate)

instead of:

MFCCs = librosa.feature.mfcc(signal, sample_rate)

then I don't get this warning.

fedotiK
  • 41
  • 5