// // Programmer: Craig Stuart Sapp // Creation Date: Sun Jan 20 12:13:18 PST 2002 // Last Modified: Sun Feb 3 11:08:04 PST 2002 (updated for soundfile 2.0) // Filename: ...soundfile/examples/writetest.cpp // Syntax: C++ // // Description: Test writing a soundfile using SoundFileWrite class. // #include "soundfile.h" #include #ifndef OLDCPP #include using namespace std; #else #include #endif int main(int argc, char** argv) { Options options; options.define("n|samples=i:100", "number of samples to write"); options.define("s|start=i:0", "starting value to write"); options.define("d|double=b", "write samples also as doubles"); options.process(argc, argv); if (options.getArgCount() == 0) { cout << "Usage: " << options.getCommand() << " [-n count][-s start][-d] filename" << endl; exit(1); } SoundHeader header; header.setHighMono(); SoundFileWrite soundfile(options.getArg(1), header); int count = options.getInteger("samples"); int start = options.getInteger("start"); int i; for (i=0; i