From 10342efb0a5ca881feeb4bedfd6a82fbf5e6635e Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 30 Apr 2012 22:35:46 +0200 Subject: stereo wave recording --- rec.ck | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/rec.ck b/rec.ck index 1a30a5f..10d8d09 100644 --- a/rec.ck +++ b/rec.ck @@ -1,24 +1,23 @@ -// chuck this with other shreds to record to file -// example> chuck foo.ck bar.ck rec (see also rec2.ck) +/* + * dac master wave recorder + * arguments: (default "out") + * will write _left.wav, _right.wav + */ -// FIXME: stereo recording +if (me.args() > 1) + me.exit(); -// arguments: rec: - -// get name -me.arg(0) => string filename; -if (!filename.length()) - "foo.wav" => filename; +"out" => string filename; +if (me.args() > 0) + me.arg(0) => filename; // pull samples from the dac -dac => Gain g => WvOut w => blackhole; -// this is the output file name -filename => w.wavFilename; -<<<"writing to file:", "'" + w.filename() + "'">>>; +dac.chan(0) => WvOut out_left => blackhole; +dac.chan(1) => WvOut out_right => blackhole; + +filename+"_left.wav" => out_left.wavFilename; +filename+"_right.wav" => out_right.wavFilename; -// any gain you want for the output -//.5 => g.gain; +<<< "writing to files:", out_left.filename(), out_right.filename() >>>; -// infinite time loop... -// ctrl-c will stop it, or modify to desired duration while (day => now); -- cgit v1.2.3