<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"> snd := (SampledSound fromWaveFileNamed: 'aWAVFile.wav').<br>
snd addEnvelope: (VolumeEnvelope exponentialDecay: 0.96).</font>
<br><font size=3 face="Times New Roman"> 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"> snd storeWAVOnFileNamed: ' out.wav'.<br>
</font>
<br><font size=2 face="sans-serif">should have done what you want, but obviously it does not. 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"> -Dean</font>
<br>
<br>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>"Rob Rothwell" <r.j.rothwell@gmail.com></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 </font>
<br>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To: squeak-dev@lists.squeakfoundation.org</font>
<br><font size=1 face="sans-serif"> cc: </font>
<br><font size=1 face="sans-serif"> Subject: 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? I am creating a MixedSound which includes both a RepeatingSound (based on a looped SampledSound from a WAV file), and an FMSound. <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? 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>