ref: c03e7777e63a0202d21f99fa08039ac65f8c581f
dir: /python/aubioplot-audio/
#!/usr/bin/python import sys from aubio.gnuplot import gnuplot_create,gnuplot_addargs,plot_audio usage = "usage: %s [options] -i soundfile" % sys.argv[0] def parse_args(): from optparse import OptionParser parser = OptionParser(usage=usage) parser.add_option("-i","--input", action="store", dest="filename", help="input sound file") gnuplot_addargs(parser) (options, args) = parser.parse_args() if not options.filename: print "no file name given\n", usage sys.exit(1) return options, args options, args = parse_args() if options.outplot: extension = options.outplot.split('.')[-1] outplot = '.'.join(options.outplot.split('.')[:-1]) else: extension = '' outplot = None g = gnuplot_create(outplot,extension,options) plot_audio(options.filename.split(','), g, options)