use gnuplot_create in plot_audio
authorPaul Brossier <piem@altern.org>
Wed, 2 Aug 2006 11:24:50 +0000 (11:24 +0000)
committerPaul Brossier <piem@altern.org>
Wed, 2 Aug 2006 11:24:50 +0000 (11:24 +0000)
use gnuplot_create in plot_audio

python/aubio/gnuplot.py
python/aubioplot-audio

index 69c02b54b00260d92fd585e16110f4d62f3e5403..f60903984b0ac79eeb0d195149cf291553895a4e 100644 (file)
@@ -45,8 +45,8 @@ def audio_to_array(filename):
        time = numarray.arange(len(data))*framestep
        return time,data
 
-def plot_audio(filenames, fileout=None, start=0, end=None, noaxis=None,xsize=1.,ysize=1.):
-       g = gnuplot_init(fileout)
+def plot_audio(filenames, outplot='', extension='', start=0, end=None, noaxis=None,xsize=1.,ysize=1.):
+       g = gnuplot_create(outplot, extension)
        d = []
        todraw = len(filenames)
        xorig = 0.
index 02dc7bc9e4cc3b24226df7f59ef40abc3b67d956..9a15b2a574c85c5619ae2eeb71278a179aef79c3 100755 (executable)
@@ -27,7 +27,15 @@ def parse_args():
 
 options, args = parse_args()
 
+if options.outplot: 
+  extension = options.outplot.split('.')[-1] 
+  outplot = '.'.join(options.outplot.split('.')[:-1])
+else: 
+  extension = ''
+  outplot = None
+
 aubio.gnuplot.plot_audio(options.filename.split(','),
-  fileout=options.outplot,
+  extension = extension,
+  outplot = outplot,
   xsize=float(options.xsize),
   ysize=float(options.ysize))