Changeset 3f9e8e5 for python/scripts


Ignore:
Timestamp:
Jan 11, 2014, 10:45:10 PM (10 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
88432a9
Parents:
9d1606d
Message:

python/scripts/aubiocut: add -o, --output directory option

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/scripts/aubiocut

    r9d1606d r3f9e8e5  
    107107            help="add spectrogram to the plot")
    108108    """
     109    parser.add_option("-o","--output", type = str,
     110            metavar = "<outputdir>",
     111            action="store", dest="output_directory", default=None,
     112            help="specify path where slices of the original file should be created")
    109113    parser.add_option("-v","--verbose",
    110114            action="store_true", dest="verbose", default=True,
     
    165169        import os
    166170        source_base_name, source_ext = os.path.splitext(os.path.basename(source_file))
     171        if options.output_directory != None:
     172            if not os.path.isdir(options.output_directory):
     173                os.makedirs(options.output_directory)
     174            source_base_name = os.path.join(options.output_directory, source_base_name)
    167175        def new_sink_name(source_base_name, timestamp):
    168176            return source_base_name + '_%02.3f' % (timestamp) + '.wav'
Note: See TracChangeset for help on using the changeset viewer.