Mercurial > hg > swc-python-audio
changeset 2:9885d7b7aca0
Plotting the new signal using pylab/matplotlib.
| author | luisf <luis.figueira@eecs.qmul.ac.uk> |
|---|---|
| date | Mon, 11 Feb 2013 16:36:10 +0000 |
| parents | 003b86796d1b |
| children | 162d64fb861c |
| files | audio_io.py |
| diffstat | 1 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/audio_io.py Mon Feb 11 16:00:03 2013 +0000 +++ b/audio_io.py Mon Feb 11 16:36:10 2013 +0000 @@ -1,5 +1,6 @@ -# imports audiolab import scikits.audiolab as audiolab +import pylab as plt +import numpy as np # create Sndfile instance with our example audio file f = audiolab.Sndfile('viola.wav', 'r') @@ -53,6 +54,13 @@ new_samples = samples[0:new_nsamples] ################# +## Plotting the new signal using pylab/matplotlib +################# + +plt.plot(new_samples) +plt.show() + +################# ## Writing the shorter audio to a new file ################# @@ -68,3 +76,8 @@ # close the audio file f.close() + + + + +
