Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Get line in volume in C#

Posted on 2011-03-01
3
Medium Priority
?
440 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

598 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