Showing the changes to examples/basic (3 of 6 files). Show all
Unified · Split
| @@ -14,6 +14,8 @@ dac => WvOut2 w => blackhole; · 13 unmodified lines | ||
| 14 | 14 | |
| 15 | 15 | // this is the output file name |
| 16 | 16 | "special:auto" => w.wavFilename; |
| 17 | +// optionally specify bit depth | |
| 18 | +// ("special:auto", IO.INT24) => w.wavFilename; | |
| 17 | 19 | |
| 18 | 20 | // print it out |
| 19 | 21 | <<<"writing to file: ", w.filename()>>>; |
| @@ -14,6 +14,8 @@ dac => Gain g => WvOut w => blackhole; · 13 unmodified lines | ||
| 14 | 14 | |
| 15 | 15 | // this is the output file name |
| 16 | 16 | "special:auto" => w.wavFilename; |
| 17 | +// optionally specify bit depth | |
| 18 | +// ("special:auto", IO.INT24) => w.wavFilename; | |
| 17 | 19 | |
| 18 | 20 | // print it out |
| 19 | 21 | <<<"writing to file: ", w.filename()>>>; |
| @@ -1,17 +1,24 @@ | ||
| 1 | 1 | // chuck this with other shreds to record to file |
| 2 | 2 | // example> chuck foo.ck bar.ck rec.ck |
| 3 | 3 | // (see also rec-auto-stereo.ck) |
| 4 | − | |
| 4 | +// | |
| 5 | 5 | // arguments: rec:<filename> |
| 6 | 6 | |
| 7 | +// filename | |
| 8 | +string filename; | |
| 7 | 9 | // get name |
| 8 | −me.arg(0) => string filename; | |
| 9 | −if( filename.length() == 0 ) "foo.wav" => filename; | |
| 10 | +if( me.args() > 0 ) me.arg(0) => filename; | |
| 11 | +// default | |
| 12 | +if( filename == "" ) "foo.wav" => filename; | |
| 10 | 13 | |
| 11 | 14 | // pull samples from the dac |
| 12 | 15 | dac => Gain g => WvOut w => blackhole; |
| 13 | 16 | // this is the output file name |
| 14 | 17 | filename => w.wavFilename; |
| 18 | +// optionally specify bit depth | |
| 19 | +// (filename, IO.INT24) => w.wavFilename; | |
| 20 | + | |
| 21 | ||
| 15 | 22 | <<<"writing to file:", "'" + w.filename() + "'">>>; |
| 16 | 23 | // any gain you want for the output |
| 17 | 24 | .5 => g.gain; |