Page 1 of 1
Detect if sound card is present/enabled?
Posted: Sun May 11, 2025 1:53 am
by BarryG
Asking mainly for Windows. Need a way to check if a sound card is present and enabled, because not all users have one (as I recently found out), and if not found or enabled then some sound code can crash my app (like getting the volume and mute status). I tried using InitSound() but Fred said that's not the way.
Re: Detect if sound card is present/enabled?
Posted: Sun May 11, 2025 2:48 am
by RASHAD
Re: Detect if sound card is present/enabled?
Posted: Sun May 11, 2025 6:41 am
by BarryG
Thanks, but that doesn't work: it just loads the sound and plays it silently. I don't want that; I want it to message me that no sound can be played because there's no audio device enabled on the PC.
This is what Winamp shows when no audio device is available/enabled. I'd love to show something like that.

Re: Detect if sound card is present/enabled?
Posted: Sun May 11, 2025 11:23 am
by ZX80
@BarryG
I suggest you try the following:
enumerate hardware devices
P.S. If the hardware is not present in the system, then this should work and it is obvious.
P.S.2. Also you can use the console utility, known as 'devcon.exe'. Be careful, it has two different version (x86 _n_ x64).
Re: Detect if sound card is present/enabled?
Posted: Sun May 11, 2025 11:47 am
by mk-soft