I don’t think FSOUND_StopSound( FSOUND_ALL ) is checking see if a channel exist before it tries to stop it?
I say this because FSOUND_StopSound( FSOUND_ALL ) returns an error under the following circumstances:
- call FSOUND_Init(), requesting a max of N software channels
- use less then N channels during the program run
- call FSOUND_StopSound( FSOUND_ALL ) <== return “Invalid Arg” error
If I understand corrently, resources for a channel are not allocated until there is a need. And once a channel is allocated, it remains until FSOUND_Close() is called. It seems that FSOUND_StopSound( FSOUND_ALL ) is looking at how many channels have been requested, not how many have actually been allocated. This leads to it trying to silence channels that don’t exist, and thus generate an error.
Granted, this is not a major problem at all, and its easy to work around by explicity checking if a channel is playing before trying to stop it, but it would be nice if FSOUND_StopSound() were smart enough to handle this itself.
- DGuy asked 17 years ago
- You must login to post comments