source: python/aubioplot-audio @ 4b4e6ae

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 4b4e6ae was da5edf3, checked in by Paul Brossier <piem@altern.org>, 19 years ago

add aubioplot-audio
add aubioplot-audio

  • Property mode set to 100755
File size: 1.2 KB
Line 
1#!/usr/bin/python
2
3import aubio.gnuplot, sys
4
5usage = "usage: %s [options] -i soundfile" % sys.argv[0]
6
7def parse_args():
8        from optparse import OptionParser
9        parser = OptionParser(usage=usage)
10        parser.add_option("-i","--input",
11                          action="store", dest="filename", 
12                          help="input sound file")
13        parser.add_option("-x","--xsize",
14                          action="store", dest="xsize", default=1., 
15                          help="define xsize for plot")
16        parser.add_option("-y","--ysize",
17                          action="store", dest="ysize", default=1., 
18                          help="define ysize for plot")
19        parser.add_option("-O","--outplot",
20                          action="store", dest="outplot", default=None, 
21                          help="save plot to output.{ps,png}")
22        (options, args) = parser.parse_args()
23        if not options.filename: 
24                 print "no file name given\n", usage
25                 sys.exit(1)
26        return options, args
27
28options, args = parse_args()
29
30aubio.gnuplot.plot_audio(options.filename.split(','),
31  fileout=options.outplot,
32  xsize=float(options.xsize),
33  ysize=float(options.ysize))
Note: See TracBrowser for help on using the repository browser.