Solved

Get line in volume in C#

Posted on 2011-03-01
3
430 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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