~ubuntu-branches/ubuntu/gutsy/libsamplerate/gutsy

« back to all changes in this revision

Viewing changes to tests/src-evaluate.c

  • Committer: Bazaar Package Importer
  • Author(s): Anand Kumria
  • Date: 2005-11-26 09:44:31 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051126094431-q45da3haxdd72g0i
Tags: 0.1.2-2
* Previous upload was rejected by ftp-master becasue they felt that
  having only a single binary in samplerate-programs was not a good
  idea.
* Include all example programs instead

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <string.h>
23
23
#include <ctype.h>
24
24
 
 
25
#include "config.h"
 
26
 
 
27
#if (HAVE_FFTW3 && HAVE_SNDFILE && HAVE_SYS_TIMES_H)
 
28
 
25
29
#include <time.h>
26
30
#include <sys/times.h>
27
31
 
28
 
#include "config.h"
29
 
 
30
 
#if (HAVE_FFTW3 && HAVE_SNDFILE)
31
 
 
32
32
#include <sndfile.h>
33
33
#include <math.h>
34
34
#include <sys/utsname.h>
38
38
 
39
39
#define MAX_FREQS               4
40
40
#define BUFFER_LEN              40000
41
 
#define ARRAY_LEN(x)    ((int) ((sizeof (x)) / (sizeof ((x) [0]))))
42
41
 
43
42
#define SAFE_STRNCAT(dest,src,len)                                                              \
44
43
                {       int safe_strncat_count ;                                                        \
347
346
        *output_samples = 0 ;
348
347
 
349
348
        for (k = 0 ; k < ARRAY_LEN (snr_test) ; k++)
350
 
        {       unlink ("source.wav") ;
351
 
                unlink ("destination.wav") ;
 
349
        {       remove ("source.wav") ;
 
350
                remove ("destination.wav") ;
352
351
 
353
352
                if (verbose)
354
353
                        printf ("       SNR test #%d : ", k) ;
425
424
 
426
425
        generate_source_wav ("source.wav", &freq, 1, prog->format) ;
427
426
 
428
 
        unlink (filename) ;
 
427
        remove (filename) ;
429
428
 
430
429
        snprintf (command, sizeof (command), prog->convert_cmd, 88189) ;
431
430
        SAFE_STRNCAT (command, " >/dev/null", sizeof (command)) ;