<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I was looking in your book and copied listing 4.3 &quot; Playing a sound file backward&quot;</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
But it didn't work. Hopefully i did everything correctly. It did perform the first (forward) part but during the reverse part i heard nothing. Can you please help me....</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Kind regards,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Herman</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
&nbsp;<span>// copy Listing 4.3 Playing a sound file backward<br>
</span>
<div>// from Programming for Musicians and digital artists by Ge Wang<br>
</div>
<div><br>
</div>
<div>me.sourceDir() &#43; &quot;sample.wav&quot; =&gt; string filename;<br>
</div>
<div>if( me.args() ) me.arg(0) =&gt; filename;<br>
</div>
<div><br>
</div>
<div>// the patch <br>
</div>
<div>SndBuf mySound =&gt; dac;<br>
</div>
<div><br>
</div>
<div>// load the file in buf<br>
</div>
<div>filename =&gt; mySound.read;<br>
</div>
<div><br>
</div>
<div>mySound.samples() =&gt; int numSamples;<br>
</div>
<div><br>
</div>
<div><span style="color: rgb(12, 136, 42);">0 =&gt; mySound.pos;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // this was ok&nbsp; &nbsp; &nbsp; &nbsp;</span><br>
</div>
<div><span style="color: rgb(12, 136, 42);">numSamples::samp =&gt; now;</span><br>
</div>
<div><br>
</div>
<div><span style="color: rgb(200, 38, 19);">numSamples =&gt; mySound.pos;&nbsp; &nbsp; &nbsp;// This was not heard. Athough the program stayed in VM.&nbsp;</span><br>
</div>
<div><span style="color: rgb(200, 38, 19);">-1.0 =&gt; mySound.rate;</span><br>
</div>
<span style="color: rgb(200, 38, 19);">numSamples::samp =&gt; now;</span></div>
</body>
</html>