// We can plot the probability curve over time:
plt.figure(figsize=(12, 4))
plt.plot(times, p, label="P[V=1|x]")
plt.axhline(0.5, color="r", alpha=0.5, label="Descision threshold")
plt.xlabel("Time")
plt.axis("tight")
After Change
fig, ax = plt.subplots()
ax.plot(times, rms)
ax.axhline(0.02, color="r", alpha=0.5)
ax.set(xlabel="Time", ylabel="RMS");
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// The red line at 0.02 indicates a reasonable threshold for silence detection.