Changeset b3f79ca for python/demos


Ignore:
Timestamp:
Sep 20, 2016, 11:24:46 PM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch
Children:
a0e0f56
Parents:
46243dd4
Message:

python/demos/demo_pitchshift.py: add mode option

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/demos/demo_pitchshift.py

    r46243dd4 rb3f79ca  
    66if __name__ == '__main__':
    77    if len(sys.argv) < 3:
    8         print('usage: %s <inputfile> <outputfile> [transpose] [samplerate] [hop_size]' % sys.argv[0])
     8        print('usage: %s <inputfile> <outputfile> [transpose] [samplerate] [hop_size] [mode]' % sys.argv[0])
     9        print('available modes: default, crispness:0, crispness:1, ... crispness:6')
    910        sys.exit(1)
    1011    if len(sys.argv) > 3: transpose = float(sys.argv[3])
     
    1415    if len(sys.argv) > 5: hop_size = int(sys.argv[5])
    1516    else: hop_size = 256
     17    if len(sys.argv) > 6: mode = sys.argv[6]
     18    else: mode = available_modes[0]
    1619
    1720    source_read = aubio.source(sys.argv[1], samplerate, hop_size)
     
    1922    sink_out = aubio.sink(sys.argv[2], samplerate)
    2023
    21     pitchshifter = aubio.pitchshift("default", 1., hop_size, samplerate)
     24    pitchshifter = aubio.pitchshift(mode, 1., hop_size, samplerate)
    2225    if transpose: pitchshifter.set_transpose(transpose)
    2326
Note: See TracChangeset for help on using the changeset viewer.