I am wondering if there's a way to read a range between specific timing. Currently, I am using librosa to calculate each note of the rms. Here is the following code.
import librosa
import matplotlib.pyplot as plt
y, sr = librosa.load(librosa.ex('trumpet'))
librosa.feature.rms(y=y)
S, phase = librosa.magphase(librosa.stft(y))
rms = librosa.feature.rms(S=S)
times = librosa.times_like(rms)
plt.semilogy(times, rms[0], label='RMS Energy')
But Let's say we just want the timing between 1.8 to 2.4. Then, how to do so?

Librosa loads samples to, looking at your code, to
y. The sampling rate,sr, tells you how many samples you have in each second. Knowing the two:From there you can proceed with rest of your analysis.