1. Description
When doing speech segmentation, the waveform diagram of the audio file is needed.
2. The code is as follows
import librosa
import librosa.display as ld
import matplotlib.pyplot as plt
# Load audio file
audio_file = 'SA1.WAV'
y, sr = librosa.load(audio_file)
# Plot waveform
plt.figure(figsize=(14, 5))
librosa.display.waveshow(y, sr=sr)
plt.title('Waveform')
plt.xlabel('Time (s)')
plt.ylabel('Amplitude')
plt.show()