Hello, I'm searching information about SndBuff and WvOut (and WvIn?) In the same project I want to record and play sounds but I have some problems... To explain: adc => Gain g => WvOut wOut => blackhole; .5 => g.gain; SndBuf buf => dac; "/.../blablabla.wav" => string filename; filename => wOut.wavFilename; 5::second => now; wOut.closeFile; //5::second => now; //filename => buf.read; //5::second => now; me.exit(); ...No problem... adc => Gain g => WvOut wOut => blackhole; .5 => g.gain; SndBuf buf => dac; "/.../blablabla.wav" => string filename; //filename => wOut.wavFilename; //5::second => now; //wOut.closeFile; //5::second => now; filename => buf.read; 5::second => now; me.exit(); ...No problem... But adc => Gain g => WvOut wOut => blackhole; .5 => g.gain; SndBuf buf => dac; "/.../blablabla.wav" => string filename; filename => wOut.wavFilename; 5::second => now; wOut.closeFile; 5::second => now; filename => buf.read; 5::second => now; me.exit(); ...Return: chuck: ugen_xxx.cpp:2637: void sndbuf_ctrl_read(Chuck_Object*, void*, Chuck_DL_Return*, Chuck_VM_Shred*): Assertion `d->fd == __null' failed. Why? Thanck you, Giulio.
Hey Giulio, I can get your code to work/not crash if you change "wOut.closeFile;" to "wOut.closeFile();". wOut.closeFile refers to the function closeFile, but does not actually call it; the parentheses cause it to be called and the file to actually be closed. SndBuf is causing chuck to crash because its choking on the WAV file, which is not a proper WAV file on disk until its properly closed. In general, I don't think its appropriate that chuck would crash here, but I can fix that pretty easily. Secondly, I recommend looking into the LiSa ugen -- it can accomplish much of what you seem to be attempting here. See http://chuck.stanford.edu/doc/program/ugen_full.html#LiSa for more info. spencer On Sun, Apr 15, 2012 at 1:44 PM, giulio <106ohm@gmail.com> wrote:
Hello, I'm searching information about SndBuff and WvOut (and WvIn?) In the same project I want to record and play sounds but I have some problems...
To explain:
adc => Gain g => WvOut wOut => blackhole;
.5 => g.gain;
SndBuf buf => dac;
"/.../blablabla.wav" => string filename;
filename => wOut.wavFilename;
5::second => now;
wOut.closeFile;
//5::second => now;
//filename => buf.read;
//5::second => now;
me.exit();
...No problem...
adc => Gain g => WvOut wOut => blackhole;
.5 => g.gain;
SndBuf buf => dac;
"/.../blablabla.wav" => string filename;
//filename => wOut.wavFilename;
//5::second => now;
//wOut.closeFile;
//5::second => now;
filename => buf.read;
5::second => now;
me.exit();
...No problem... But
adc => Gain g => WvOut wOut => blackhole;
.5 => g.gain;
SndBuf buf => dac;
"/.../blablabla.wav" => string filename;
filename => wOut.wavFilename;
5::second => now;
wOut.closeFile;
5::second => now;
filename => buf.read;
5::second => now;
me.exit();
...Return:
chuck: ugen_xxx.cpp:2637: void sndbuf_ctrl_read(Chuck_Object*, void*, Chuck_DL_Return*, Chuck_VM_Shred*): Assertion `d->fd == __null' failed.
Why?
Thanck you, Giulio. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Thank you! For careless I forgot the parentheses... I'm going also to study lisa. -- "Credere a tutto e dubitare di tutto sono due soluzioni ugualmente comode; poiché entrambe ci dispensano dal pensare" (E. Poincharée) This message use UTF-8 codec
participants (3)
-
106ohm(G.Masetti)
-
giulio
-
Spencer Salazar