Changeset 2a49114


Ignore:
Timestamp:
Feb 23, 2014, 9:42:00 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
584016f
Parents:
060a313
Message:

python/lib/aubio/slicing.py: respect source number of channels when slicing

File:
1 edited

Legend:

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

    r060a313 r2a49114  
    4545    while True:
    4646        # get hopsize new samples from source
    47         vec, read = s()
     47        vec, read = s.do_multi()
    4848        # if the total number of frames read will exceed the next region start
    4949        if len(regions) and total_frames + read >= regions[0][0]:
     
    5454            new_sink_path = new_sink_name(source_base_name, start_stamp, samplerate)
    5555            # create its sink
    56             g = sink(new_sink_path, samplerate)
     56            g = sink(new_sink_path, samplerate, s.channels)
    5757            # create a dictionary containing all this
    5858            new_slice = {'start_stamp': start_stamp, 'end_stamp': end_stamp, 'sink': g}
     
    7373                if remaining > start:
    7474                    # write remaining samples from current region
    75                     g(vec[start:remaining], remaining - start)
     75                    g.do_multi(vec[:,start:remaining], remaining - start)
    7676                    #print "closing region", "remaining", remaining
    7777                    # close this file
     
    7979            elif read > start:
    8080                # write all the samples
    81                 g(vec[start:read], read - start)
     81                g.do_multi(vec[:,start:read], read - start)
    8282        total_frames += read
    8383        if read < hopsize: break
Note: See TracChangeset for help on using the changeset viewer.