Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Setting The Microphone Recording Volume

Setting The Microphone Recording Volume

Scheduled Pinned Locked Moved C / C++ / MFC
debuggingquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jerry0davis
    wrote on last edited by
    #1

    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? TIA MCI_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

    4 1 Reply Last reply
    0
    • J jerry0davis

      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? TIA MCI_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

      4 Offline
      4 Offline
      4apai
      wrote on last edited by
      #2

      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.

      T 1 Reply Last reply
      0
      • 4 4apai

        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.

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        You Are Right as Always $api ----------------------------- "I Think It Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups