0

The sample data is wav files from Kaggle: Emotional Speech database for classification problem

2018r...@mnit.ac.in's profile photo
2018r...@mnit.ac.in
unread,
12:00 AM (19 hours ago) 
to librosa

I am using the following code snippet, want to rcv the font size of the axes also the wav file length is 2 seconds long, but why is it plotting only for 1.5 seconds plz guide.

import matplotlib.pyplot as plt
import librosa
import librosa.display
import glob
    path=glob.glob('E:/Python_On_All_Dataset/Four emotion_for plot/*.wav') 
    
    fig, ax =  plt.subplots(nrows=7, ncols=3, sharex=True)
    plt.rcParams['font.size'] = '1'
    
    for i in range(7) :
       
        y, sr = librosa.load(path[i], sr=16000)
        librosa.display.waveplot(y, sr, ax=ax[i, 0])  # put wave in row i, column 0
      
        mfcc=librosa.feature.mfcc(y) 
        librosa.display.specshow(mfcc, x_axis='time', ax=ax[i, 1],cmap='viridis') # mfcc in row i, column 1
       
        S = librosa.feature.melspectrogram(y, sr)
        librosa.display.specshow(librosa.power_to_db(S), x_axis='time', y_axis='log', ax=ax[i, 2],cmap='viridis')  # spectrogram in row i, column 2

enter image description here

Trenton McKinney
  • 43,885
  • 25
  • 111
  • 113

0 Answers0