0
0

Hi. StopSound/setvolume etc wants the channel number, not the handler. But i have no idea what exact channel my samples are playing at from time to time, and the tutorial says i can just pass the handle (which seems resonable). I can play it but the stopSound doenst compile since it wants the channel number (int). How to solve this?

FSOUND_SAMPLE* s1;

FSOUND_Init (44100, 32, 0);
s1=FSOUND_Sample_Load (0,"snd/weapon/minibomb.wav",0,0,0);
FSOUND_PlaySound (0,s1);

FSOUND_StopSound (s1);

from tutorial:

When we want to stop the sample we just use:
FSOUND_StopSound (handle);

And once again can the parameter be a channel number.

It doesnt work…
Thanks for your help

  • You must to post comments
0
0

FSOUND_PlaySound returns the channel that it played the sound on. Also, it’s recommended to use FSOUND_FREE. Check the docs on this.

[code:22n6dzrf]int channel = FSOUND_PlaySound(FSOUND_FREE, s1);

(wait for a keypress or something so we don’t stop the sound immediately)

FSOUND_StopSound(channel);
[/code:22n6dzrf]

Cheers,

  • You must to post comments
0
0

Sorry I accidently deleted your account, there was an influx of spammers and you must have got caught up in the mass delete 😳

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.