*/
#include "utils.h"
+#define PROG_HAS_SILENCE 1
#include "parse_args.h"
sint_t wassilence = 1, issilence;
void process_block(fvec_t * ibuf, fvec_t * obuf) {
fvec_zeros (obuf);
- if (aubio_silence_detection(ibuf, silence)==1) {
+ if (aubio_silence_detection(ibuf, silence_threshold)==1) {
if (wassilence==1) issilence = 1;
else issilence = 2;
wassilence=1;
}
}
-static void process_print (void) {
+void process_print (void) {
int curblocks = (blocks - 4) > 0 ? blocks - 4 : 0;
- if (issilence == -1) {
- outmsg("NOISY: %f\n",curblocks*hop_size/(float)samplerate);
- } else if (issilence == 2) {
- outmsg("QUIET: %f\n",curblocks*hop_size/(float)samplerate);
+ if (issilence == -1 || issilence == 2) {
+ if (issilence == -1) {
+ outmsg ("NOISY: ");
+ } else { // if (issilence == 2) {
+ outmsg ("QUIET: ");
+ }
+ print_time (curblocks * hop_size);
+ outmsg ("\n");
}
}