none
Progress Bar to Voice RRS feed

  • Question

  • Ok. I need help to have a progress bar change  VALUE due of the loudness or how noisy the microphone is. Ive tried to search everywhere and i cant find how. I saw a video long time ago but i forgot wat it is called. 

    Basically I want how loud the Output (not input sorry) of the mic is

    Wednesday, July 31, 2019 3:01 AM

All replies

  • Hi,

    Did you look into the NAudio NuGet package?

    https://github.com/naudio/NAudio

    https://www.nuget.org/packages/NAudio/

    Kind regards,

    Johnny Hooyberghs

    Wednesday, July 31, 2019 5:10 AM
  • There is no shortcut for reading the volume of the microphone.  You have to read all the audio, as if you were recording it, and compute the average volume.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Wednesday, July 31, 2019 7:19 AM
  • Hi TheMasterOfVCode,

    Thank you for posting here.

    Based on your description, you want to progress bar change will change when the voice volume changed.

    I make a windows form app, you could have a look.

        public partial class Form1 : Form
        {
            private System.Timers.Timer myTimer;
            public Form1()
            {
                InitializeComponent();
            }
      
            private void Form1_Load(object sender, EventArgs e)
            {
                this.myTimer = new System.Timers.Timer(10);
                this.myTimer.Elapsed += new System.Timers.ElapsedEventHandler(myTimer_Elapsed);
                this.myTimer.AutoReset = true;
                this.myTimer.Enabled = true;
                this.myTimer.SynchronizingObject = this;
                this.myTimer.Start();
    
            }
            CoreAudioDevice defaultPlaybackDevice = new CoreAudioController().DefaultPlaybackDevice;
          
            private void myTimer_Elapsed(object sender, ElapsedEventArgs e)
            {
                pBar1.Value = (int)defaultPlaybackDevice.Volume;
            }
    
        }

    Note:Please Install-Package AudioSwitcher.AudioApi.CoreAudio.

    Result:

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, July 31, 2019 7:23 AM
    Moderator
  • Hi Jack, sadly that is not my question it was for how loud the mic output was giving.

    Wednesday, July 31, 2019 5:17 PM
  • Tim Roberts Thats not my question either.
    Wednesday, July 31, 2019 5:19 PM
  • Thank You Johnny. I have found a video according to ur response


    Wednesday, July 31, 2019 5:22 PM