I've got all audio disabled on my PC but InitSound() doesn't return 0. I was hoping to use InitSound() so my app knows NOT to use audio APIs if it returns 0 for no audio, but I can't.
Doesn't InitSound() just build a bridge between you program and the Windows sound system (which itself looks for devices) and just returns that it "successfully connected to the Windows component"?
Nowaday the sound system will be almost always successful, because you can plugin USB headset etc. which can enable sound on the go. So you can't rely to InitSound() to detect a sound card
BarryG wrote: Sat May 10, 2025 5:49 am
I've got all audio disabled on my PC but InitSound() doesn't return 0. I was hoping to use InitSound() so my app knows NOT to use audio APIs if it returns 0 for no audio, but I can't.
What do you mean, all audio disabled? You have all soundcards disconnected/disabled?
Hi Quin. Yes, what I mean is I went into Device Manager and disabled all audio components, because it turns out some users don't have sound cards, and my app was crashing for them due to it. So I need a way to detect if a sound card is present/enabled or not, and I thought InitSound() would do the job; but as Fred said, you can't use it like that.