Solved

Get line in volume in C#

Posted on 2011-03-01
3
423 Views
Last Modified: 2012-05-11
Hey.
I want to access the line in volume in C# .net 4.0.

I dont need exact decibels but I want to be able to gage what the volume is relative to a previous point in time.

Preferably I want to be able to poll the sound volume every 100 ms and build an average of the relative sound loudness.

My end goal is to be able to set a threshold when the sound in the room is to loud and i can get a warning.

I know its possible, MSN Messenger does this in it's setup.
 msn messenger sound setup
0
Comment
Question by:Lime_Sweden
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 33

Accepted Solution

by:
Todd Gerbert earned 500 total points
ID: 35012452
There's nothing "built-in" to C# to do that sort of task.  You either need to do extensive P/Invoke interop work with native Windows APIs, or look for a ready-made wrapper for .Net.  I also know Windows XP and Windows Vista/7 have very different ways of handling audio.

Have a look at NAudio - it's a .Net wrapper around the Win32 APIs - it's the only such library I know off the top of my head, but I've never used it.  I'm sure there are others as well.

http://naudio.codeplex.com/
0
 

Assisted Solution

by:Lime_Sweden
Lime_Sweden earned 0 total points
ID: 35014984
Thanks to you link i found my way here:
http://voicerecorder.codeplex.com/

working example doing exactly what i want in C#.
0
 

Author Closing Comment

by:Lime_Sweden
ID: 35045731
I have to state a reason for accepting my own comment.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question