<br><font size=2 face="sans-serif">Hi Rob,</font>
<br>
<br><font size=2 face="sans-serif">If you try this:</font>
<br>
<br><font size=3 face="Times New Roman">&nbsp; &nbsp; &nbsp; &nbsp; snd := (SampledSound fromWaveFileNamed: 'aWAVFile.wav').<br>
 &nbsp; &nbsp; &nbsp; &nbsp;snd addEnvelope: (VolumeEnvelope exponentialDecay: 0.96).</font>
<br><font size=3 face="Times New Roman">&nbsp; &nbsp; &nbsp; &nbsp; snd play.</font>
<br>
<br><font size=2 face="sans-serif">You will hear the effect of the envelope, as desired.</font>
<br>
<br><font size=2 face="sans-serif">This:</font><font size=3 face="Times New Roman"><br>
</font>
<br><font size=3 face="Times New Roman">&nbsp; &nbsp; &nbsp; &nbsp; snd storeWAVOnFileNamed: ' out.wav'.<br>
</font>
<br><font size=2 face="sans-serif">should have done what you want, but obviously it does not. &nbsp;I have spent a little time tracking this, but I haven't found the problem yet.</font>
<br>
<br><font size=2 face="sans-serif">I will send another reply when I figure this out (maybe today, or later this weekend).</font>
<br>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; -Dean</font>
<br>
<br>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>&quot;Rob Rothwell&quot; &lt;r.j.rothwell@gmail.com&gt;</b></font>
<br><font size=1 face="sans-serif">Sent by: squeak-dev-bounces@lists.squeakfoundation.org</font>
<p><font size=1 face="sans-serif">05/03/2006 10:25 PM</font>
<br><font size=1 face="sans-serif">Please respond to rjriv; Please respond to The general-purpose Squeak developers list &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br>
<td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp; &nbsp;squeak-dev@lists.squeakfoundation.org</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;How to Fade-In/Fade-Out a Sampled/Repeating/Mixed Sound</font></table>
<br>
<br>
<br><font size=3 face="Times New Roman">Does anyone know how to fade a mixed sound? &nbsp;I am creating a MixedSound which includes both a RepeatingSound (based on a looped SampledSound from a WAV file), and an FMSound. &nbsp;<br>
<br>
I pretty much know how to apply a VolumeEnvelope to an FMSound by looking at the exponentialDecay method, but applying a VolumeEnvelope to a SampledSound, RepeatingSound, or MixedSound seems to have no effect. <br>
<br>
For example...<br>
<br>
snd := RepeatingSound new.<br>
snd setSound: (SampledSound fromWaveFileNamed: 'aWAVFile.wav') iterations: 1.<br>
snd addEnvelope: (VolumeEnvelope exponentialDecay: 0.96).<br>
snd storeWAVOnFileNamed: ' out.wav'.<br>
<br>
...shows no effect on the waveforms in the resulting WAV file, even if I change the step size of the increments in the exponentialDecay to drag the decay out much further...<br>
<br>
Do I need to write a method to modify the SoundBuffer values of the SampledSound directly? &nbsp;If so, I'm afraid I will need much more help! <br>
<br>
I just don't know enough technically about sound generation to trace my way through the updateTargetAt method of the VolumeEnvelope class to figure out what is going on with a non-FMSound...<br>
<br>
Thanks,<br>
<br>
Rob<br>
<br>
</font><font size=2 face="Courier New"><br>
</font>
<br>
<br>