summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-04-30 22:35:46 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-04-30 22:35:46 +0200
commit10342efb0a5ca881feeb4bedfd6a82fbf5e6635e (patch)
treebc25b7486d64518a257063ec25f51007fa2cfbbb
parent76dbc41ed584cdec8571c42b8fbfacf7eada07e4 (diff)
downloaddigitale-debutanten-10342efb0a5ca881feeb4bedfd6a82fbf5e6635e.tar.gz
stereo wave recording
-rw-r--r--rec.ck33
1 files 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: <base_filename> (default "out")
+ * will write <base_filename>_left.wav, <base_filename>_right.wav
+ */
-// FIXME: stereo recording
+if (me.args() > 1)
+ me.exit();
-// arguments: rec:<filename>
-
-// 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);