Changeset c9c012e


Ignore:
Timestamp:
Oct 29, 2018, 3:32:24 PM (6 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
Children:
d194d8c
Parents:
a88594d
Message:

[py] [slicing] add option create_first, default to False

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/lib/aubio/slicing.py

    ra88594d rc9c012e  
    77
    88def slice_source_at_stamps(source_file, timestamps, timestamps_end=None,
    9                            output_dir=None, samplerate=0, hopsize=256):
     9                           output_dir=None, samplerate=0, hopsize=256,
     10                           create_first=False):
    1011    """ slice a sound file at given timestamps """
    1112
     
    1314        raise ValueError("no timestamps given")
    1415
    15     if timestamps[0] != 0:
     16    if timestamps[0] != 0 and create_first:
    1617        timestamps = [0] + timestamps
    1718        if timestamps_end is not None:
     
    7879                    # write remaining samples from current region
    7980                    _sink.do_multi(vec[:, start:remaining], remaining - start)
    80                     #print "closing region", "remaining", remaining
     81                    #print("closing region", "remaining", remaining)
    8182                    # close this file
    8283                    _sink.close()
Note: See TracChangeset for help on using the changeset viewer.