Audio--waveoutgetnumdevs and Mixergetnumdevs

Source: Internet
Author: User
There is a big difference between Waveoutgetnumdevs and Mixergetnumdevs. Or an example to see the phenomenon of my machine has three sound cards, respectively: 0--serial audio Device 1--usb audio Play 2--vinyl AC ' EG1: #define My_aud Io_name "Serial Audio Device" int Getwaveoutid () {

int ndevnum = Mixergetnumdevs (); The difference is right here. Ndevnum is 2

Can't get USB audio play this virtual sound card
int _twaveoutid =-1;
for (int i=0;i<ndevnum;i++)
{
Mixercaps Stmixercaps;
char * psdest = NULL;
memset (&stmixercaps, 0, sizeof (stmixercaps));
Mixergetdevcaps (i, &stmixercaps, sizeof (stmixercaps));
Psdest = Strstr (Stmixercaps.szpname, my_audio_name);
AfxMessageBox (Stmixercaps.szpname);
if (psdest!=null)
{
_twaveoutid=i;
}

}

return _twaveoutid; }/////////////////////////////////////////////////////////////EG2: #define MY_AUDIO_NAME "Serial AUDIO Device" int Getwaveoutid () {

int ndevnum = Mixergetnumdevs (); The difference is right here. Ndevnum is 3

Can get USB audio play this virtual sound card
int _twaveoutid =-1;
for (int i=0;i<ndevnum;i++)
{
Mixercaps Stmixercaps;
char * psdest = NULL;
memset (&stmixercaps, 0, sizeof (stmixercaps));
Mixergetdevcaps (i, &stmixercaps, sizeof (stmixercaps));
Psdest = Strstr (Stmixercaps.szpname, my_audio_name);
AfxMessageBox (Stmixercaps.szpname);
if (psdest!=null)
{
_twaveoutid=i;
}

}

 return _twaveoutid; }/////////////////////////////////////////////////////////////////////// The   phenomenon is like this, let's take a look at the introduction of Waveoutgetnumdevs and Mixergetnumdevs Mixergetnumdevs: Get the current number of hybrid devices. Waveoutgetnumdevs: Returns the number of sound cards installed in the system.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.