?
Solved

Get line in volume in C#

Posted on 2011-03-01
3
Medium Priority
?
434 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 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

777 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