// // Programmer: Craig Stuart Sapp // Creation Date: Sun Feb 3 12:55:04 PST 2002 // Last Modified: Sun Aug 29 03:33:21 PDT 2004 (updated for compiling in GCC3) // Filename: ...soundfile/examples/sndreverse.cpp // Syntax: C++ // // Description: Demonstration of the SoundFileRead::gotoSample(). // Reverses all of the samples from input soundfile. // #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); if (options.getArgCount() != 2) { cout << "Usage: " << options.getCommand() << " insound outsound" << endl; exit(1); } SoundFileRead insound(options.getArg(1)); SoundFileWrite outsound(options.getArg(2), insound); int channels = insound.getChannels(); int totalsamples = insound.getSamples(); int i, j; for (i=totalsamples - 1; i >= 0; i--) { insound.gotoSample(i); for (j=0; j