Mercurial > pygar
view tools/audio_processor_test/null/checker/checker.cpp @ 33:2c8166d205d5 pygar svn.34
[svn r34] uses scratchpad, set up for audio through c
author | punk |
---|---|
date | Tue, 04 May 2010 10:13:53 -0400 |
parents | 90197e3375e2 |
children |
line wrap: on
line source
1 #include <stdio.h>2 #include <assert.h>3 #include <string.h>4 #include "SndfileWavUtil.h"6 typedef unsigned short UINT16;8 int9 main (int argc, char * argv [])10 {11 const char* inputWavFileName;12 const char* outputWavFileName;14 FILE *inputPcmFile;15 FILE *outputPcmFile;17 UINT16 sample;19 inputWavFileName = argv[1];20 outputWavFileName = argv[2];22 // Convert input wav to pcm23 generate_pcm(inputWavFileName, "input.pcm");25 inputPcmFile = fopen("input.pcm", "r");26 outputPcmFile = fopen("output.pcm", "w");28 assert(inputPcmFile);29 assert(outputPcmFile);31 while(fread(&sample, 2, 1, inputPcmFile)) {32 assert(fwrite(&sample,2,1,outputPcmFile));33 }35 fclose(inputPcmFile);36 fclose(outputPcmFile);38 generate_wav("output.pcm", inputWavFileName, outputWavFileName);40 }