🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.multimedia
Article #1034

Re: How to detect a Sound Blaster??

#1034
From: Rodolfo Frino
Date: Sat, 17 Nov 2001 05:18
50 lines
2003 bytes
Hi Paolo

The following code will detect all sound devices

void Detect_SoundDevices()
{
    int n_of_sound_devices;
    WAVEOUTCAPS caps;

    if ( ( n_of_sound_devices = waveOutGetNumDevs() ) == 0 )
    {
        ShowMessage ( "No Sound Devices Found.\n\
                Sound will not be played.");
    }
    else
    {
        String DeviceNameList =
                   "Your System has the following Sound Devices: \n";

        for ( int i=0; i < n_of_sound_devices; i++ )
        {
            MMRESULT error_code = waveOutGetDevCaps( i, &caps,
sizeof(caps));

            if ( error_code == MMSYSERR_NOERROR )
            {
                DeviceNameList += "\n" + String (caps.szPname);
            }
        }
        ShowMessage(DeviceNameList);
    }

}
//----------------------------------------------------------------------


Regards
Rodolfo


"Paolo Borlandi" <pborland@tin.it> wrote in message news:3bf3df49_2@dnews...
> My application need to know if a sound blaster is plugged in the PC. How
can
> I know about it? Have some example??
>
> THANK YOU VERY MUCH!!!
>
> Paolo
>
>
Technical Details
Message-ID: <3bf5f4e3_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews
References: <3bf3df49_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d0fc,30169452a414fc19
X-Google-Attributes: gid10d0fc,public
X-Google-ArrivalTime: 2001-11-16 21:31:00 PST
From: "Rodolfo Frino" <starcinema2001@iprimus.com.au>
Newsgroups: borland.public.cppbuilder.multimedia
References: <3bf3df49_2@dnews>
Subject: Re: How to detect a Sound Blaster??
Date: Sat, 17 Nov 2001 16:18:20 +1100
Lines: 52
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 210.50.100.92
Message-ID: <3bf5f4e3_1@dnews>
X-Trace: dnews 1005974755 210.50.100.92 (16 Nov 2001 21:25:55 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews