import os
import scipy.io
import scipy.io.wavfile
import numpy as np
import matplotlib.pyplot as plt
dataset_path = os.path.join(os.environ['HOME'], 'shared', 'data', 'assignment_1')
wavedata = os.path.join(dataset_path, 'example.wav')
fs, audio_buffer = scipy.io.wavfile.read(wavedata)
And I kinda cannot understand how to further use matplotlib.pyplot Would be grateful for any advice or right documentation!
this will plot the wav audio file in its native time domain as a time series
Notice the plot accurately renders time which is derived from the WAV file headers which defines the sample rate ... along with bit depth and channel count ... those attributes give the code ability to parse the binary WAV file byte by byte which get rendered as a series of points on the displayed curve ( each point is an audio sample for given channel )