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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 =&gt;my_sample.pos; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my_sample =&gt; dac;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3::second =&gt; now;<br>
}<br><br>
<br>
<br><div><span class="gmail_quote">On 10/19/05, <b class="gmail_sendername">Nelson Ferraz</b> &lt;<a href="mailto:nferraz@gmail.com">nferraz@gmail.com</a>&gt; 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 &quot;towers of annoy&quot; example<br>-- yes, it's possible.<br><br>Here's my first ChucK program, which I called &quot;hello_wav.ck&quot;:
<br><br>// the sound samples<br>sndbuf my_sample;<br><br>// load files<br>&quot;wav/Heartbeat Bass.wav&quot; =&gt; my_sample.read;<br><br>// set gain<br>.5 =&gt; my_sample.gain;<br><br>// play<br>my_sample =&gt; dac;<br>3::second =&gt; now;
<br><br><br>It worked just fine.<br><br>Now, I'd like to play the heartbeat sound &quot;ad infinitum&quot;... I tried<br>this, but it doesn't work:<br><br>while (1) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my_sample =&gt; dac;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3::second =&gt; 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>