Thanks to a tip from Tom Lieber (who pointed out that WvOut doesn't actually handle stereo files), here's a snippet of ChucK code people might find useful:<br><br>if (me.args() > 1) {<br> dac.chan(0) => Gain g0 => WvOut w0 => blackhole;<br>
dac.chan(1) => Gain g1 => WvOut w1 => blackhole;<br> 0.5 => g0.gain;<br> 0.5 => g1.gain;<br> me.arg(0) => w0.wavFilename;<br> me.arg(1) => w1.wavFilename;<br> <<< "writing stereo output to files", me.arg(0), me.arg(1) >>>;<br>
} else if (me.args() > 0) {<br> dac => Gain g => WvOut w => blackhole;<br> 0.5 => g.gain;<br> me.arg(0) => w.wavFilename;<br> <<< "writing mono output to file", me.arg(0) >>>;<br>
}<br><br>Since it attaches to the dac, you can put it just about anywhere in your ChucK program. When you invoke chuck as in :<br><br>% chuck mytest.ck:bleeep.wav<br><br>it will write everything your program sends to the dac to a mono "bleeep.wav" file. If you invoke it as in:<br>
<br>% chuck mytest.ck:bleep_0.wav:bleep_1.wav<br><br>it will write everything you program sends to the dac to two mono files: bleep_0.wav (left channel) andn bleep_1.wav (right channel). It's up to you to weave the two files together into a stereo sound file. There are several ways to do it -- I tend to use Audacity.<br>
<br>- Rob<br><br>