Our current game is written in Delphi 5 and we are using FMod for all sound and music.
The problem is that on some sound cards (usually generic OEM cards) FMod fails to initialize and reports “Error setting cooperative level for hardware”. Actually that’s not completely true the first one or two times you run the game everything is fine but after that it fails with the above error. Now here is the strange part. After FMod stops working you can run another program like Winamp and it will fix the problem. After you force winamp or some other program like it to play a sound you can then go back to the game and FMod will be fine again for one or two loads. My first thought was that I’m not shutting down FMod correctly but from what I can tell from the help file it’s kind of hard to screw that up. This is the code that I use to shut down FMod. Please tell me if I’m doing something wrong or forgetting something important.
if Loaded then begin FSOUND_StopSound(FSOUND_ALL); //shutoff all channels for iLoop := 0 to GlobalSoundList.Count - 1 do FSOUND_Sample_Free(GlobalSoundList.Objects[ iLoop ]); GlobalSoundList.clear; for iLoop := 0 to MapSoundList.Count - 1 do FSOUND_Sample_Free(MapSoundList.Objects[ iLoop ]); MapSoundList.clear; for iLoop := 0 to CharacterSoundList.Count - 1 do FSOUND_Sample_Free(CharacterSoundList.Objects[ iLoop ]); CharacterSoundList.Clear; for iLoop := 0 to PowerSoundList.Count - 1 do FSOUND_Sample_Free(PowerSoundList.Objects[ iLoop ]); PowerSoundList.clear; log.log('Freeing FMod'); FSOUND_Close( ); end;
My development machine has a SB live card and no matter how many times I restart the game I can not reproduce this. However I have seen it happen consistently on four other machines in our office so I know something is wrong. If you have any other ideas on what might be the cause or any suggestions on how I might fix it I would love to hear them.
Thanks for any help you can offer!
- Bauldazar asked 16 years ago
- You must login to post comments