// // Programmer: Craig Stuart Sapp // Creation Date: Wed Feb 13 15:31:09 PST 2002 // Last Modified: Sun Aug 29 03:33:21 PDT 2004 (updated for compiling in GCC3) // Filename: ...soundfile/examples/snd16.cpp // Syntax: C++ // For: Sachiko Deguchi // // Description: Convert arbirary bits samples to 16 bit samples. // For example 24 bits sample to 16, but also // 8-bit to 16-bit samples as well. // #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* inputname = options.getArg(1); const char* outputname = options.getArg(2); SoundFileRead insound(inputname); SoundHeader header; header.setHighMono(); header.setChannels(insound.getChannels()); header.setSrate(insound.getSrate()); SoundFileWrite outsound(outputname, header); int i, channel; for (i=0; i