summaryrefslogtreecommitdiff
path: root/rec.ck
blob: 1a30a5f3c5367d7adb0bd9f4e1eda6c35a5b3d8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// chuck this with other shreds to record to file
// example> chuck foo.ck bar.ck rec (see also rec2.ck)

// FIXME: stereo recording

// arguments: rec:<filename>

// get name
me.arg(0) => string filename;
if (!filename.length())
	"foo.wav" => 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() + "'">>>;

// any gain you want for the output
//.5 => g.gain;

// infinite time loop...
// ctrl-c will stop it, or modify to desired duration
while (day => now);