From: Paul Brossier Date: Wed, 2 Aug 2006 11:24:50 +0000 (+0000) Subject: use gnuplot_create in plot_audio X-Git-Tag: bzr2git~576 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9bb81518cd90758975a611fb92c217ac7ba07d40;p=aubio.git use gnuplot_create in plot_audio use gnuplot_create in plot_audio --- diff --git a/python/aubio/gnuplot.py b/python/aubio/gnuplot.py index 69c02b54..f6090398 100644 --- a/python/aubio/gnuplot.py +++ b/python/aubio/gnuplot.py @@ -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. diff --git a/python/aubioplot-audio b/python/aubioplot-audio index 02dc7bc9..9a15b2a5 100755 --- a/python/aubioplot-audio +++ b/python/aubioplot-audio @@ -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))