I have only tested on MorphOS, but there seems to be a topic which might be related (even though not exactly the same): viewtopic.php?p=21437
I'll report this to the bugs section to get noticed better.
Code: Select all
; create a sample
smpdata = {}
slen = 32
For k = 0 To 3000
For i = 0 To (slen\2)-1
smpdata[k*slen+i] = -128
smpdata[k*slen+i+(slen\2)] = 127
Next
Next
CreateSample(1, smpdata, 6982)
; play it
PlaySample(1)
Wait(50)
Print("Volume should decrease now.")
; try to set its volume
For Local vol = 64 To 0 Step -1
Wait(5)
;StopSample(1) ; it works when sample isn't playing
SetVolume(1, vol) ; Doesn't work on-the-fly as supposed!
;PlaySample(1) ; ugly work-around that doesn't sound good
Next
WaitLeftMouse()
BTW. there's a small mistake in the documentation ("k" vs. "vol"):
Code: Select all
For k = 64 To 0 Step -1
SetVolume(1,vol)
Next