From f41f5c4d72b1b14fb66c1f3f39ef727cd32a6cdd Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 6 Nov 2005 11:38:54 +0000 Subject: [PATCH] added aubioquiet in examples added aubioquiet in examples --- examples/Makefile.am | 3 ++ examples/aubioquiet.c | 76 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 examples/aubioquiet.c diff --git a/examples/Makefile.am b/examples/Makefile.am index fbaca77d..7084f954 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -11,6 +11,7 @@ AM_LDFLAGS = -L../src -L../ext @LADCCA_LIBS@ -laubioext -laubio bin_PROGRAMS = \ aubioonset \ aubiotrack \ + aubioquiet \ aubionotes EXTRA_DIST = utils.h @@ -19,7 +20,9 @@ EXTRA_DIST = utils.h aubioonset_SOURCES = aubioonset.c utils.c aubionotes_SOURCES = aubionotes.c utils.c aubiotrack_SOURCES = aubiotrack.c utils.c +aubioquiet_SOURCES = aubioquiet.c utils.c aubioonset_LDADD = @JACK_LIBS@ aubionotes_LDADD = @JACK_LIBS@ aubiotrack_LDADD = @JACK_LIBS@ +aubioquiet_LDADD = @JACK_LIBS@ diff --git a/examples/aubioquiet.c b/examples/aubioquiet.c new file mode 100644 index 00000000..7161f6bf --- /dev/null +++ b/examples/aubioquiet.c @@ -0,0 +1,76 @@ +/* + Copyright (C) 2003 Paul Brossier + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "utils.h" + +unsigned int pos = 0; /*frames%dspblocksize*/ +sint_t wassilence = 1, issilence; +uint_t usepitch = 0; + +int aubio_process(float **input, float **output, int nframes); +int aubio_process(float **input, float **output, int nframes) { + unsigned int i; /*channels*/ + unsigned int j; /*frames*/ + for (j=0;j 0 ? frames -4 : 0; + if (issilence == -1) { + outmsg("NOISY: %f\n",curframes*overlap_size/(float)samplerate); + } else if (issilence == 2) { + outmsg("QUIET: %f\n",curframes*overlap_size/(float)samplerate); + } +} + +int main(int argc, char **argv) { + examples_common_init(argc,argv); + examples_common_process(aubio_process,process_print); + examples_common_del(); + debug("End of program.\n"); + fflush(stderr); + return 0; +} + -- 2.26.2