// // Programmer: Craig Stuart Sapp // Creation Date: Wed Jan 23 21:58:50 PST 2002 // Last Modified: Sun Feb 3 11:08:04 PST 2002 (updated for soundfile 2.0) // Filename: ...soundfile/examples/sndsubtract.cpp // Syntax: C++ // // Description: subtract two sound files and store results in a third // soundfile. Input soundfiles are assumed to have the // same number of channels and ideally should have the // same length. // #include "soundfile.h" #include #ifndef OLDCPP #include using namespace std; #else #include #endif int main(int argc, char** argv) { Options options; options.process(argc, argv); const char* inputname1 = options.getArg(1); const char* inputname2 = options.getArg(2); const char* outputname = options.getArg(3); SoundFileRead insound1(inputname1); SoundFileRead insound2(inputname2); SoundFileWrite outsound(outputname, insound1); int i, channel; double sample = 0.0; for (i=0; i