I think you need to set the starting position where to read the buffer from inside the while-loop.<br>
something like:<br>
<br>
while (1) {<br>
0 =>my_sample.pos; <br>
my_sample => dac;<br>
3::second => now;<br>
}<br><br>
<br>
<br><div><span class="gmail_quote">On 10/19/05, <b class="gmail_sendername">Nelson Ferraz</b> <<a href="mailto:nferraz@gmail.com">nferraz@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I was wondering if it would be possible to use ChucK to script wave<br>files, and I found the answer in one of the "towers of annoy" example<br>-- yes, it's possible.<br><br>Here's my first ChucK program, which I called "hello_wav.ck":
<br><br>// the sound samples<br>sndbuf my_sample;<br><br>// load files<br>"wav/Heartbeat Bass.wav" => my_sample.read;<br><br>// set gain<br>.5 => my_sample.gain;<br><br>// play<br>my_sample => dac;<br>3::second => now;
<br><br><br>It worked just fine.<br><br>Now, I'd like to play the heartbeat sound "ad infinitum"... I tried<br>this, but it doesn't work:<br><br>while (1) {<br> my_sample => dac;<br> 3::second => now;
<br>}<br><br>Any ideas?<br>_______________________________________________<br>chuck-users mailing list<br><a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br><a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users">
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br></blockquote></div><br>