// // Programmer: Craig Stuart Sapp // Creation Date: Sun Jan 19 07:51:14 PST 2003 // Last Modified: Sun Jan 19 07:51:17 PST 2003 // Filename: ...sig/doc/examples/sig/sigfile/addsnd/addsnd.cpp // Syntax: C++; sig // // Description: Adds multiple sound files into one file. The // channel count of the output file is equal to // the maximum channel count of the input files. // All input soundfiles must contain the same // sampling rete. If they do not, then the sample // rate of the first soundfile in the input list // will be used. // // Usage: addsnd [-a ampscale] insound(s) outsound // // Options: // -a = scale the amplitude of all input soundfiles by this value. // --options = list of all options, aliases and defaults // #include "sigAudio.h" #include #ifndef OLDCPP #include using namespace std; #else #include #endif void checkOptions(Options& opts); void example(void); void usage(const char* command); double amplitude = 1.0; // used with -a option /////////////////////////////////////////////////////////////////////////// int main(int argc, char* argv[]) { Options options(argc, argv); checkOptions(options); int incount = options.getArgCount() - 1; SoundHeader* headers; headers = new SoundHeader[incount]; int maxchannel = 0; int maxsamples = 0; int i, j; for (i=0; i