Changeset 7625d85


Ignore:
Timestamp:
Nov 28, 2018, 3:28:30 PM (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/pydocstrings, feature/timestretch, fix/ffmpeg5, master
Children:
c0ce78f
Parents:
f73f3fb
Message:

[tests] check new_aubio_pitch fails with wrong parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/src/pitch/test-pitch.c

    rf73f3fb r7625d85  
    3131  aubio_cleanup ();
    3232
     33  if (new_aubio_pitch(0, win_s, hop_s, samplerate)) return 1;
     34  if (new_aubio_pitch("unknown", win_s, hop_s, samplerate)) return 1;
     35  if (new_aubio_pitch("default", win_s,     0, samplerate)) return 1;
     36  if (new_aubio_pitch("default",     0, hop_s, samplerate)) return 1;
     37  if (new_aubio_pitch("default", hop_s, win_s, samplerate)) return 1;
     38  if (new_aubio_pitch("default", win_s, hop_s,          0)) return 1;
     39
     40  o = new_aubio_pitch("default", win_s, hop_s, samplerate);
     41
     42  if (aubio_pitch_set_unit(o, "freq")) return 1;
     43  if (aubio_pitch_set_unit(o, "hertz")) return 1;
     44  if (aubio_pitch_set_unit(o, "Hertz")) return 1;
     45  if (aubio_pitch_set_unit(o, "Hz")) return 1;
     46  if (aubio_pitch_set_unit(o, "f0")) return 1;
     47  if (aubio_pitch_set_unit(o, "midi")) return 1;
     48  if (aubio_pitch_set_unit(o, "cent")) return 1;
     49  if (aubio_pitch_set_unit(o, "bin")) return 1;
     50  if (!aubio_pitch_set_unit(o, "unknown")) return 1;
     51
     52  if (aubio_pitch_set_tolerance(o, 0.3)) return 1;
     53  if (aubio_pitch_set_silence(o, 0)) return 1;
     54  if (aubio_pitch_set_silence(o, -200)) return 1;
     55  if (!aubio_pitch_set_silence(o, -300)) return 1;
     56  del_aubio_pitch(o);
     57
     58  // fft based might fail with non power of 2
     59  o = new_aubio_pitch("yinfft", win_s + 1, hop_s, samplerate);
     60  if (o) del_aubio_pitch(o);
     61  o = new_aubio_pitch("yinfast", win_s + 1, hop_s, samplerate);
     62  if (o) del_aubio_pitch(o);
     63  o = new_aubio_pitch("fcomb", win_s + 1, hop_s, samplerate);
     64  if (o) del_aubio_pitch(o);
     65  o = new_aubio_pitch("mcomb", win_s + 1, hop_s, samplerate);
     66  if (o) del_aubio_pitch(o);
     67  o = new_aubio_pitch("specacf", win_s + 1, hop_s, samplerate);
     68  if (o) del_aubio_pitch(o);
     69
    3370  return 0;
    3471}
Note: See TracChangeset for help on using the changeset viewer.