shithub: aubio

Download patch

ref: 9bb81518cd90758975a611fb92c217ac7ba07d40
parent: 778bc7a3e1bb9eed9eeb669dbd20c63879283264
author: Paul Brossier <piem@altern.org>
date: Wed Aug 2 07:24:50 EDT 2006

use gnuplot_create in plot_audio
use gnuplot_create in plot_audio


--- a/python/aubio/gnuplot.py
+++ b/python/aubio/gnuplot.py
@@ -45,8 +45,8 @@
 	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.
--- a/python/aubioplot-audio
+++ b/python/aubioplot-audio
@@ -27,7 +27,15 @@
 
 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))