Ignore:
Timestamp:
Dec 1, 2018, 10:57:07 AM (5 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/timestretch, fix/ffmpeg5, master
Children:
c1ba75b
Parents:
bbfa9a4 (diff), bde4f641 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into feature/pytest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/src/synth/test-sampler.c

    rbbfa9a4 radc6e02  
     1#include <string.h> // strncpy
     2#include <limits.h> // PATH_MAX
    13#include <aubio.h>
    24#include "utils_tests.h"
     
    68  sint_t err = 0;
    79
    8   if (argc < 4) {
    9     err = 2;
    10     PRINT_ERR("not enough arguments\n");
     10  if (argc < 3) {
     11    PRINT_ERR("not enough arguments, running tests\n");
     12    err = run_on_default_source_and_sink(main);
    1113    PRINT_MSG("usage: %s <input_path> <output_path> <sample_path> [samplerate]\n", argv[0]);
    1214    return err;
     
    1921  char_t *source_path = argv[1];
    2022  char_t *sink_path = argv[2];
    21   char_t *sample_path = argv[3];
    22   if ( argc == 5 ) samplerate = atoi(argv[4]);
     23  char_t sample_path[PATH_MAX];
     24  if ( argc >= 4 ) {
     25    strncpy(sample_path, argv[3], PATH_MAX - 1);
     26  } else {
     27    // use input_path as sample
     28    strncpy(sample_path, source_path, PATH_MAX - 1);
     29  }
     30  sample_path[PATH_MAX - 1] = '\0';
     31  if ( argc >= 5 ) samplerate = atoi(argv[4]);
    2332
    2433  fvec_t *vec = new_fvec(hop_size);
Note: See TracChangeset for help on using the changeset viewer.