Mercurial > pygar
comparison tools/audio_processor_test/null/checker/checker.cpp @ 23:90197e3375e2 pygar svn.24
[svn r24] added testing, but something is wrong with our c++ file.
author | rlm |
---|---|
date | Wed, 28 Apr 2010 08:19:09 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
22:0cfbb1e2de22 | 23:90197e3375e2 |
---|---|
1 #include <stdio.h> | |
2 #include <assert.h> | |
3 #include <string.h> | |
4 #include "SndfileWavUtil.h" | |
5 | |
6 typedef unsigned short UINT16; | |
7 | |
8 int | |
9 main (int argc, char * argv []) | |
10 { | |
11 const char* inputWavFileName; | |
12 const char* outputWavFileName; | |
13 | |
14 FILE *inputPcmFile; | |
15 FILE *outputPcmFile; | |
16 | |
17 UINT16 sample; | |
18 | |
19 inputWavFileName = argv[1]; | |
20 outputWavFileName = argv[2]; | |
21 | |
22 // Convert input wav to pcm | |
23 generate_pcm(inputWavFileName, "input.pcm"); | |
24 | |
25 inputPcmFile = fopen("input.pcm", "r"); | |
26 outputPcmFile = fopen("output.pcm", "w"); | |
27 | |
28 assert(inputPcmFile); | |
29 assert(outputPcmFile); | |
30 | |
31 while(fread(&sample, 2, 1, inputPcmFile)) { | |
32 assert(fwrite(&sample,2,1,outputPcmFile)); | |
33 } | |
34 | |
35 fclose(inputPcmFile); | |
36 fclose(outputPcmFile); | |
37 | |
38 generate_wav("output.pcm", inputWavFileName, outputWavFileName); | |
39 | |
40 } | |
41 |