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. Visual Studio
  4. On-Off Mouse-Keyboard By Microphone Sound Level

On-Off Mouse-Keyboard By Microphone Sound Level

Scheduled Pinned Locked Moved Visual Studio
c++
4 Posts 2 Posters 2 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.
  • T Offline
    T Offline
    TaniDani
    wrote on last edited by
    #1

    Hallo, I need to make in practice a application running in WIN7. This application must read continuously the sound(noise) received from the microphone and, if the level of the sound(noise) is higher that a adjusted value, to activate to display a Jpeg image on the screen and at the same time to deactivate the sound, the mouse and the keyboard. To have a adjusted delay and after the delay time to reactivate the sound, the mouse and the keyboard. This application must start at StartUp of PC. I need to use this application in a computer class room at every PC with WIN7. This can be a batch file or a C++ or everything else.

    T Richard Andrew x64R 2 Replies Last reply
    0
    • T TaniDani

      Hallo, I need to make in practice a application running in WIN7. This application must read continuously the sound(noise) received from the microphone and, if the level of the sound(noise) is higher that a adjusted value, to activate to display a Jpeg image on the screen and at the same time to deactivate the sound, the mouse and the keyboard. To have a adjusted delay and after the delay time to reactivate the sound, the mouse and the keyboard. This application must start at StartUp of PC. I need to use this application in a computer class room at every PC with WIN7. This can be a batch file or a C++ or everything else.

      T Offline
      T Offline
      TaniDani
      wrote on last edited by
      #2

      I have a information from Matthew van Eerde: If you had said Windows 8 I would have recommended the MediaCapture API. As it is, with Windows 7 I suggest using IAudioMeterInformation. When your program starts up, grab the default recording device via IMMDeviceEnumerator::GetDefaultAudioEndpoint and activate an IAudioMeterInformation. Then query the peak value in a loop, and if it exceeds your threshold value, do whatever. IMMDeviceEnumerator *pMMDeviceEnumerator hr = CoCreateInstance( __uuidof(MMDeviceEnumerator), NULL, CLSCTX_ALL, __uuidof(IMMDeviceEnumerator), (void**)&pMMDeviceEnumerator ) if (FAILED(hr)) { ... } IMMDevice *pMMDevice hr = pMMDeviceEnumerator->GetDefaultAudioEndpoint(eCapture, eConsole, &pMMDevice) if (FAILED(hr)) { ... } IAudioMeterInformation *pAudioMeterInformation hr = pMMDevice->Activate( __uuidof(IAudioMeterInformation), CLSCTX_ALL, NULL, (void**)&pAudioMeterInformation ); if (FAILED(hr)) { ... } while (...) { float peak; hr = pAudioMeterInformation->GetPeakValue(&peak); if (FAILED(hr)) { ... } if (peak > ... ) { ... } ... }

      1 Reply Last reply
      0
      • T TaniDani

        Hallo, I need to make in practice a application running in WIN7. This application must read continuously the sound(noise) received from the microphone and, if the level of the sound(noise) is higher that a adjusted value, to activate to display a Jpeg image on the screen and at the same time to deactivate the sound, the mouse and the keyboard. To have a adjusted delay and after the delay time to reactivate the sound, the mouse and the keyboard. This application must start at StartUp of PC. I need to use this application in a computer class room at every PC with WIN7. This can be a batch file or a C++ or everything else.

        Richard Andrew x64R Offline
        Richard Andrew x64R Offline
        Richard Andrew x64
        wrote on last edited by
        #3

        Okay. So what is your question?

        The difficult we do right away... ...the impossible takes slightly longer.

        T 1 Reply Last reply
        0
        • Richard Andrew x64R Richard Andrew x64

          Okay. So what is your question?

          The difficult we do right away... ...the impossible takes slightly longer.

          T Offline
          T Offline
          TaniDani
          wrote on last edited by
          #4

          Because I am not a programmer, I dont know how to do. This are .net or visual C or I can write them in a .txt and execute like .dll ? With witch program can I execute them ? How to do: On/Off input from mouse and keyboard ? How to open a .Jpeg immage ?

          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