Setting The Microphone Recording Volume
-
I have a USB Telephone which is basically a USB speaker and microphone. I am having trouble setting the recording volume. I know I need to use
mciSendCommand(wDeviceID, MCI_SETAUDIO, MCI_DGV_SETAUDIO_VOLUME, (DWORD)volume);
. I am having trouble finding the wDeviceID for the microphone. I have written some test code to find the wDeviceID and device name, but even that doesn't work! :-( Can anyone tell me what I'm doing wrong please? TIAMCI_SYSINFO_PARMS siParams; ZeroMemory(&siParams, sizeof(siParams)); char str[MAX_PATH]; siParams.lpstrReturn = str; siParams.dwRetSize = MAX_PATH; siParams.wDeviceType = MCI_ALL_DEVICE_ID; for(int i = 0; i < 5; i++) { siParams.dwNumber = i; MCIERROR mci = mciSendCommand( i, MCI_SYSINFO, MCI_SYSINFO_NAME, (DWORD)(LPMCI_SYSINFO_PARMS)&siParams); TRACE("%d %02d, %s\n", mci, i, siParams.lpstrReturn); }
I feel like I'm diagonally parked in a parallel universe Jerry Davis http://www.astad.org
http://www.jvf.co.uk -
I have a USB Telephone which is basically a USB speaker and microphone. I am having trouble setting the recording volume. I know I need to use
mciSendCommand(wDeviceID, MCI_SETAUDIO, MCI_DGV_SETAUDIO_VOLUME, (DWORD)volume);
. I am having trouble finding the wDeviceID for the microphone. I have written some test code to find the wDeviceID and device name, but even that doesn't work! :-( Can anyone tell me what I'm doing wrong please? TIAMCI_SYSINFO_PARMS siParams; ZeroMemory(&siParams, sizeof(siParams)); char str[MAX_PATH]; siParams.lpstrReturn = str; siParams.dwRetSize = MAX_PATH; siParams.wDeviceType = MCI_ALL_DEVICE_ID; for(int i = 0; i < 5; i++) { siParams.dwNumber = i; MCIERROR mci = mciSendCommand( i, MCI_SYSINFO, MCI_SYSINFO_NAME, (DWORD)(LPMCI_SYSINFO_PARMS)&siParams); TRACE("%d %02d, %s\n", mci, i, siParams.lpstrReturn); }
I feel like I'm diagonally parked in a parallel universe Jerry Davis http://www.astad.org
http://www.jvf.co.ukwhat about opening mci Device? there is nice code for this in msdn: UINT wDeviceID; DWORD dwReturn; MCI_OPEN_PARMS mciOpenParms; // Opens a CD audio device by specifying the device name. mciOpenParms.lpstrDeviceType = "cdaudio"; if (dwReturn = mciSendCommand(NULL, MCI_OPEN, MCI_OPEN_TYPE, (DWORD)(LPVOID) &mciOpenParms)) { // Error, unable to open device. } // The device opened successfully; get the device ID. wDeviceID = mciOpenParms.wDeviceID; 4apai There're no impossible tasks. There're tasks that required infinite period of execution time.
-
what about opening mci Device? there is nice code for this in msdn: UINT wDeviceID; DWORD dwReturn; MCI_OPEN_PARMS mciOpenParms; // Opens a CD audio device by specifying the device name. mciOpenParms.lpstrDeviceType = "cdaudio"; if (dwReturn = mciSendCommand(NULL, MCI_OPEN, MCI_OPEN_TYPE, (DWORD)(LPVOID) &mciOpenParms)) { // Error, unable to open device. } // The device opened successfully; get the device ID. wDeviceID = mciOpenParms.wDeviceID; 4apai There're no impossible tasks. There're tasks that required infinite period of execution time.
You Are Right as Always $api ----------------------------- "I Think It Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk