feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 49407f3 was
33cf541,
checked in by Paul Brossier <piem@altern.org>, 18 years ago
|
use options structure for plot_audio plot_spec
use options structure for plot_audio plot_spec
|
-
Property mode set to
100755
|
File size:
928 bytes
|
Rev | Line | |
---|
[da5edf3] | 1 | #!/usr/bin/python |
---|
| 2 | |
---|
[0ab19df] | 3 | import sys |
---|
| 4 | from aubio.gnuplot import gnuplot_create,gnuplot_addargs,plot_audio |
---|
[da5edf3] | 5 | |
---|
| 6 | usage = "usage: %s [options] -i soundfile" % sys.argv[0] |
---|
| 7 | |
---|
| 8 | def parse_args(): |
---|
| 9 | from optparse import OptionParser |
---|
| 10 | parser = OptionParser(usage=usage) |
---|
| 11 | parser.add_option("-i","--input", |
---|
| 12 | action="store", dest="filename", |
---|
| 13 | help="input sound file") |
---|
[0ab19df] | 14 | gnuplot_addargs(parser) |
---|
[da5edf3] | 15 | (options, args) = parser.parse_args() |
---|
| 16 | if not options.filename: |
---|
| 17 | print "no file name given\n", usage |
---|
| 18 | sys.exit(1) |
---|
| 19 | return options, args |
---|
| 20 | |
---|
| 21 | options, args = parse_args() |
---|
| 22 | |
---|
[9bb8151] | 23 | if options.outplot: |
---|
| 24 | extension = options.outplot.split('.')[-1] |
---|
| 25 | outplot = '.'.join(options.outplot.split('.')[:-1]) |
---|
| 26 | else: |
---|
| 27 | extension = '' |
---|
| 28 | outplot = None |
---|
| 29 | |
---|
[0ab19df] | 30 | g = gnuplot_create(outplot,extension,options) |
---|
[33cf541] | 31 | plot_audio(options.filename.split(','), g, options) |
---|
Note: See
TracBrowser
for help on using the repository browser.