[Stk] RtWvIn, RtWvIn::start(), RtWvIn::stop(), FileWvOut, FileWvIn in an example
alpana jui
lpnjui at googlemail.com
Thu Feb 5 07:40:20 PST 2009
Hello Everybody,
Could you please provide example of FileWvIn in the tutorial
attached below; also the use of RtWvIn::start() and RtWvIn::stop()
instead of defining length in the attached tuorial? This will be very
helpful.
#include "RtWvIn.h"
#include "FileWvOut.h"
int main (int argc, char* const argv[]) {
string waveOutName = "test.wav";
float length = atof ( argv[2] );
Stk::setSampleRate( 44100.0 );
RtWvIn adc; // RtWvIn: realtime input from ADC
FileWvOut output;
output.openFile( waveOutName, 1, FileWrite::FILE_WAV, Stk::STK_SINT16 );
for ( int i=0; i<(44100*length); i++ )
output.tick( adc.tick() );
output.closeFile();
return 0;
}
Thank you
More information about the Stk
mailing list