1 // chuck this with other shreds to record to file
2 // example> chuck foo.ck bar.ck rec (see also rec2.ck)
4 // arguments: rec:<filename>
7 me.arg(0) => string filename;
8 if( filename.length() == 0 ) "foo.wav" => filename;
10 // pull samples from the dac
11 dac => Gain g => WvOut w => blackhole;
12 // this is the output file name
13 filename => w.wavFilename;
14 <<<"writing to file:", "'" + w.filename() + "'">>>;
15 // any gain you want for the output
18 // infinite time loop...
19 // ctrl-c will stop it, or modify to desired duration
20 while( true ) 1::second => now;