I'm trying to get the data from a wav file in Python and plot it. When I use scipy.io.wavfile.read(), I get back an array that looks like this:
[[ -1.49836736e-02 -1.27559584e-02]
[ -1.84625713e-02 -1.63264061e-02]
[ -2.17888858e-02 -1.95001373e-02]
...,
[ 6.10332937e-05 6.10332937e-05]
[ -3.05166468e-05 0.00000000e+00]
[ 3.05166468e-05 -6.10332937e-05]]
Why is it a bunch of arrays with length 2 as opposed to one long array with the value at each sample? What does this data being returned represent? Thanks in advance.
convert_16_bit = float(2**15)
sr, samples = scipy.io.wavfile.read('singingonenote.wav')
x = np.linspace(0, 2000, 0.01)
samples = samples / (convert_16_bit + 1.0)
y = samples
print samples
plt.plot(x, y)
plt.show()