peter
2007-07-04 12:22:03 UTC
I'm trying to build a program using the mciSendString() command in Visual C++
that plays mp3 audio files on a Windows system with two sound cards. One
thing I want to do is let the user choose which sound card the audio output
is directed to.
I can get as far as showing which devices are capable of output by using
this code :
-------------------------
iNumDevs = waveOutGetNumDevs(); // Get number of devices
for (int i = 0; (i < iNumDevs) && (i < 10); i++)
{
if (!waveOutGetDevCaps(i, &woc, sizeof(WAVEOUTCAPS)))
_tprintf(_T("Device ID #%i: %s\n"), i, woc.szPname);
}
-------------------------
But I'm not sure how to build the MCI string to select the proper device
once I have the device id. I've tried using strings like :
open "c:\music\music.mp3" type mpegvideo alias mysong
which works for the primary device that you set in the Windows control panel
- but if I insert the device number in the string like :
open "c:\music\music.mp3" type mpegvideo 1 alias mysong
or
open "c:\music\music.mp3" type mpegvideo 1 alias mysong
Where 1 is the device id, I get this "The specified device is not open or is
not recognized by MCI." as an error message. So there is definetely something
wrong with the way I'm sending out the command. I've tried searching the MSDN
pages in the MCI section but I still am having no luck.
Can someone help use the MCI to select any soundcard on a computer with more
than one soundcard installed ?
that plays mp3 audio files on a Windows system with two sound cards. One
thing I want to do is let the user choose which sound card the audio output
is directed to.
I can get as far as showing which devices are capable of output by using
this code :
-------------------------
iNumDevs = waveOutGetNumDevs(); // Get number of devices
for (int i = 0; (i < iNumDevs) && (i < 10); i++)
{
if (!waveOutGetDevCaps(i, &woc, sizeof(WAVEOUTCAPS)))
_tprintf(_T("Device ID #%i: %s\n"), i, woc.szPname);
}
-------------------------
But I'm not sure how to build the MCI string to select the proper device
once I have the device id. I've tried using strings like :
open "c:\music\music.mp3" type mpegvideo alias mysong
which works for the primary device that you set in the Windows control panel
- but if I insert the device number in the string like :
open "c:\music\music.mp3" type mpegvideo 1 alias mysong
or
open "c:\music\music.mp3" type mpegvideo 1 alias mysong
Where 1 is the device id, I get this "The specified device is not open or is
not recognized by MCI." as an error message. So there is definetely something
wrong with the way I'm sending out the command. I've tried searching the MSDN
pages in the MCI section but I still am having no luck.
Can someone help use the MCI to select any soundcard on a computer with more
than one soundcard installed ?