Demo entry 6796419

1

   

Submitted by anonymous on May 15, 2019 at 04:20
Language: Python. Code size: 476 Bytes.

from scipy.io import wavfile
from matplotlib import pyplot as plt
import numpy as np

# Set the data
samplerate, data = wavfile.read('test.wav') # Load the data
times = np.arange(len(data))/float(samplerate) # Time sampling

# Set the graph
plt.figure(figsize=(30, 20)) # figuresize (width, height)
plt.fill_between(times, data, color='b') 
plt.xlim(times[0], times[-1])
plt.xlabel('time (s)')
plt.ylabel('amplitude')
plt.savefig('plot.png', dpi=100)
plt.show()

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).