shithub: aubio

Download patch

ref: 6e6849d3f05077c2540250d85362aaa8861e0316
parent: 9953f096e82d459444a8d2279f77222ddd5559da
author: Paul Brossier <piem@piem.org>
date: Wed Sep 21 13:10:56 EDT 2016

tests/src/effects/test-pitchshift.c: add option for mode, shuffle options order

--- a/tests/src/effects/test-pitchshift.c
+++ b/tests/src/effects/test-pitchshift.c
@@ -9,8 +9,9 @@
   if (argc < 4) {
     err = 2;
     PRINT_ERR("not enough arguments\n");
-    PRINT_MSG("usage: %s <input_path> <output_path> <transpose> [samplerate] [hop_size]\n", argv[0]);
+    PRINT_MSG("usage: %s <input_path> <output_path> <transpose> [mode] [hop_size] [samplerate]\n", argv[0]);
     PRINT_MSG(" with <transpose> a number of semi tones in the range [-24, 24]\n");
+    PRINT_MSG(" and [mode] in 'default', 'crispness:0', ..., 'crispness:6'\n");
     return err;
   }
 
@@ -22,12 +23,14 @@
 
   char_t *source_path = argv[1];
   char_t *sink_path = argv[2];
+  char_t *mode = "default";
 
   transpose = atof(argv[3]);
 
-  if ( argc >= 5 ) samplerate = atoi(argv[4]);
+  if ( argc >= 5 ) mode = argv[4];
   if ( argc >= 6 ) hop_size = atoi(argv[5]);
-  if ( argc >= 7 ) {
+  if ( argc >= 7 ) samplerate = atoi(argv[6]);
+  if ( argc >= 8 ) {
     err = 2;
     PRINT_ERR("too many arguments\n");
     return err;
@@ -45,7 +48,7 @@
   aubio_sink_t *o = new_aubio_sink(sink_path, samplerate);
   if (!o) { err = 1; goto beach_sink; }
 
-  aubio_pitchshift_t *ps = new_aubio_pitchshift("default", transpose, hop_size, samplerate);
+  aubio_pitchshift_t *ps = new_aubio_pitchshift(mode, transpose, hop_size, samplerate);
   if (!ps) { err = 1; goto beach_pitchshift; }
 
   do {
--