source: tests/src/io/test-sink.c @ 8f68dfb

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 8f68dfb was 5d1f716, checked in by Paul Brossier <piem@piem.org>, 12 years ago

tests/src/io/test-sink.c: added simple test

  • Property mode set to 100644
File size: 700 bytes
Line 
1#include <stdio.h>
2#include <aubio.h>
3#include "config.h"
4
5char_t *path = "/home/piem/archives/drum_Chocolate_Milk_-_Ation_Speaks_Louder_Than_Words.wav";
6char_t *outpath = "/var/tmp/test.wav";
7
8int main(){
9  int err = 0;
10  uint_t samplerate = 44100;
11  uint_t hop_size = 512;
12  uint_t read = hop_size;
13  fvec_t *vec = new_fvec(hop_size);
14  aubio_source_t * i = new_aubio_source(path, samplerate, hop_size);
15  aubio_sink_t *   o = new_aubio_sink(outpath, samplerate);
16
17  if (!i || !o) { err = -1; goto beach; }
18
19  while ( read == hop_size ) {
20    aubio_source_do(i, vec, &read);
21    aubio_sink_do(o, vec, read);
22  }
23
24beach:
25  del_aubio_source(i);
26  del_aubio_sink(o);
27  del_fvec(vec);
28  return err;
29}
30
Note: See TracBrowser for help on using the repository browser.