History

overload WvOut file open methods; WvOut2 methods now use WvOut file open methods

Ge Wang committed 3 years ago

Commit 0c05dcc1 parent 235502f6 files · +134 −73Browse files

Showing the changes to examples/basic (3 of 6 files). Show all

Unified · Split

3 files
  1. examples/basic/rec-auto-stereo.ck +2 −0
  2. examples/basic/rec-auto.ck +2 −0
  3. examples/basic/rec.ck +10 −3
examples/basic/rec-auto-stereo.ck+2−0
@@ -14,6 +14,8 @@ dac => WvOut2 w => blackhole; · 13 unmodified lines
1414
1515 // this is the output file name
1616 "special:auto" => w.wavFilename;
17+// optionally specify bit depth
18+// ("special:auto", IO.INT24) => w.wavFilename;
1719
1820 // print it out
1921 <<<"writing to file: ", w.filename()>>>;
examples/basic/rec-auto.ck+2−0
@@ -14,6 +14,8 @@ dac => Gain g => WvOut w => blackhole; · 13 unmodified lines
1414
1515 // this is the output file name
1616 "special:auto" => w.wavFilename;
17+// optionally specify bit depth
18+// ("special:auto", IO.INT24) => w.wavFilename;
1719
1820 // print it out
1921 <<<"writing to file: ", w.filename()>>>;
examples/basic/rec.ck+10−3
@@ -1,17 +1,24 @@
11 // chuck this with other shreds to record to file
22 // example> chuck foo.ck bar.ck rec.ck
33 // (see also rec-auto-stereo.ck)
4−
4+//
55 // arguments: rec:<filename>
66
7+// filename
8+string filename;
79 // 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;
1013
1114 // pull samples from the dac
1215 dac => Gain g => WvOut w => blackhole;
1316 // this is the output file name
1417 filename => w.wavFilename;
18+// optionally specify bit depth
19+// (filename, IO.INT24) => w.wavFilename;
20+
21+// print
1522 <<<"writing to file:", "'" + w.filename() + "'">>>;
1623 // any gain you want for the output
1724 .5 => g.gain;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t