From b3f79ca1e452373b919aa9c0fa1e2c66a4ee70a8 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Tue, 20 Sep 2016 23:24:46 +0200 Subject: [PATCH] python/demos/demo_pitchshift.py: add mode option --- python/demos/demo_pitchshift.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/demos/demo_pitchshift.py b/python/demos/demo_pitchshift.py index a7cd06b0..bc501607 100755 --- a/python/demos/demo_pitchshift.py +++ b/python/demos/demo_pitchshift.py @@ -5,7 +5,8 @@ import aubio if __name__ == '__main__': if len(sys.argv) < 3: - print('usage: %s [transpose] [samplerate] [hop_size]' % sys.argv[0]) + print('usage: %s [transpose] [samplerate] [hop_size] [mode]' % sys.argv[0]) + print('available modes: default, crispness:0, crispness:1, ... crispness:6') sys.exit(1) if len(sys.argv) > 3: transpose = float(sys.argv[3]) else: transpose = 12. @@ -13,12 +14,14 @@ if __name__ == '__main__': else: samplerate = 0 if len(sys.argv) > 5: hop_size = int(sys.argv[5]) else: hop_size = 256 + if len(sys.argv) > 6: mode = sys.argv[6] + else: mode = available_modes[0] source_read = aubio.source(sys.argv[1], samplerate, hop_size) if samplerate == 0: samplerate = source_read.samplerate sink_out = aubio.sink(sys.argv[2], samplerate) - pitchshifter = aubio.pitchshift("default", 1., hop_size, samplerate) + pitchshifter = aubio.pitchshift(mode, 1., hop_size, samplerate) if transpose: pitchshifter.set_transpose(transpose) total_frames, read = 0, hop_size -- 2.11.0