| 1 |
// chuck this with other shreds to record to file |
| 2 |
// example> chuck foo.ck bar.ck rec-auto.ck |
| 3 |
// (see also rec-auto-stereo.ck) |
| 4 |
|
| 5 |
// pull samples from the dac |
| 6 |
dac => Gain g => WvOut w => blackhole; |
| 7 |
|
| 8 |
// set the prefix, which will prepended to the filename |
| 9 |
// do this if you want the file to appear automatically |
| 10 |
// in another directory. if this isn't set, the file |
| 11 |
// should appear in the directory you run chuck from |
| 12 |
// with only the date and time. |
| 13 |
"chuck-session" => w.autoPrefix; |
| 14 |
|
| 15 |
// this is the output file name |
| 16 |
"special:auto" => w.wavFilename; |
| 17 |
// optionally specify bit depth |
| 18 |
// ("special:auto", IO.INT24) => w.wavFilename; |
| 19 |
|
| 20 |
// print it out |
| 21 |
<<<"writing to file: ", w.filename()>>>; |
| 22 |
|
| 23 |
// any gain you want for the output |
| 24 |
.5 => g.gain; |
| 25 |
|
| 26 |
// infinite time loop... |
| 27 |
// ctrl-c will stop it, or modify to desired duration |
| 28 |
while( true ) 1::second => now; |