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. Speaker & Mic activity meter

Speaker & Mic activity meter

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 2 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.
  • B Offline
    B Offline
    bilal78
    wrote on last edited by
    #1

    Hi All! How can i get the activity on speaker/mic so that i can build the activity meter within my aplication. My application allows voice conversation between two parties. I want to display speaker & mic activity meter on my application. Any sample or piece of code will be highly appreciated. Thanks a lot Bilal Anjum

    A 1 Reply Last reply
    0
    • B bilal78

      Hi All! How can i get the activity on speaker/mic so that i can build the activity meter within my aplication. My application allows voice conversation between two parties. I want to display speaker & mic activity meter on my application. Any sample or piece of code will be highly appreciated. Thanks a lot Bilal Anjum

      A Offline
      A Offline
      Alexander M
      wrote on last edited by
      #2

      read a raw sound block coming from the mic(they have to be quite small), then initialize 2 variables called "iMin" and "iMax"(both initialized with the null sample values), setup a loop for every sample, and then check if the sample is bigger then iMax or lower than iMin and correct the variable then. after the block, you know, that the average volume is! show a scale from 0 till sizeof(bytespersample) and show ( iMax - iMin ) there. Don't try it, just do it! ;-)

      B 1 Reply Last reply
      0
      • A Alexander M

        read a raw sound block coming from the mic(they have to be quite small), then initialize 2 variables called "iMin" and "iMax"(both initialized with the null sample values), setup a loop for every sample, and then check if the sample is bigger then iMax or lower than iMin and correct the variable then. after the block, you know, that the average volume is! show a scale from 0 till sizeof(bytespersample) and show ( iMax - iMin ) there. Don't try it, just do it! ;-)

        B Offline
        B Offline
        bilal78
        wrote on last edited by
        #3

        Hi! Thnaks for the solution, but i am just a newbie and have no idea where and how to read mic/speaker buffer? If you can tell me some APIs or any example coz i have no idea of sound APIs and data structure, that will be really helpful. Regards Bilal Anjum

        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