i´m writing a kind of tracker-proggi and in my playing-routine there is the following code:
if c.action = 1 then
if FSound_isPlaying(t.currentChannel) then
label1.caption := inttostr(t.currentChannel);
t.currentChannel := FSound_playSoundEx(FSOUND_FREE,c.sample, t.dspUnit,true);
this should stop a playing sound before playing a new sound, but it never stops the playing sound and plays the new sound additional. it goes in the true-clause of the if-statement (if FSOUND_isplaying(…)…) where the sound should be stopped with FSOUND_stopSound(..).., but it doesn´t work! i can see it by displaying the got channel-number. and i can hear it clearly.
what´s wrong here?
there´s already a check if the FSOUND_stopSound returns true. i cut it out here to keep the code-fragment small an clear. it´s returning true all the time!
if c.action is not 1, there should happen nothing, exept it´s 2, then the sound should be stopped without starting a new one. (this works fine)
but it´s no problem anymore, because i´ve desided to do my own mixing and use fmod juft for features like spectrum analysis, sample-pool-management or mp3-decoding. of course it´s not as fast as fmod, but it does exactly what i want and i understand it (so, i´ve the fastest support )
i desided so, because of this problem and another one which has to do with perfect timing.
<font size=-1>[ This Message was edited by: iGoA on 2002-02-22 06:30 ]</font>
From what I can see, your code looks fine, I would ask to questions though :
1) What If FSOUND_StopSoound(t.currentChannel) returns False?
2) What If C.action doesn’t equal 1?
Since I don’t know what is going on for you variable “C” I’m taken a bit of a guess at it. I would recommend you check for the boolean on the StopSound function.
Good luck, a tracker is a cool thing.
- NiteBeast answered 16 years ago
Please login first to submit.