Ignore:
Timestamp:
Dec 5, 2018, 10:34:39 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master
Children:
283a619a
Parents:
5b46bc3 (diff), f19db54 (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/pitchshift

File:
1 edited

Legend:

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

    r5b46bc3 r633400d  
     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.