Showing the changes to python (2 of 2 files). Show all
Unified · Split
| @@ -45,8 +45,8 @@ def audio_to_array(filename): · 44 unmodified lines | |||
| 45 | time = numarray.arange(len(data))*framestep | 45 | time = numarray.arange(len(data))*framestep |
| 46 | return time,data | 46 | return time,data |
| 47 | 47 | ||
| 48 | def plot_audio(filenames, fileout=None, start=0, end=None, noaxis=None,xsize=1.,ysize=1.): | 48 | def plot_audio(filenames, outplot='', extension='', start=0, end=None, noaxis=None,xsize=1.,ysize=1.): |
| 49 | g = gnuplot_init(fileout) | 49 | g = gnuplot_create(outplot, extension) |
| 50 | d = [] | 50 | d = [] |
| 51 | todraw = len(filenames) | 51 | todraw = len(filenames) |
| 52 | xorig = 0. | 52 | xorig = 0. |
| @@ -27,7 +27,15 @@ def parse_args(): · 26 unmodified lines | |||
| 27 | 27 | ||
| 28 | options, args = parse_args() | 28 | options, args = parse_args() |
| 29 | 29 | ||
| 30 | if options.outplot: | ||
| 31 | extension = options.outplot.split('.')[-1] | ||
| 32 | outplot = '.'.join(options.outplot.split('.')[:-1]) | ||
| 33 | else: | ||
| 34 | extension = '' | ||
| 35 | outplot = None | ||
| 36 | |||
| 30 | aubio.gnuplot.plot_audio(options.filename.split(','), | 37 | aubio.gnuplot.plot_audio(options.filename.split(','), |
| 31 | fileout=options.outplot, | 38 | extension = extension, |
| 39 | outplot = outplot, | ||
| 32 | xsize=float(options.xsize), | 40 | xsize=float(options.xsize), |
| 33 | ysize=float(options.ysize)) | 41 | ysize=float(options.ysize)) |