473,799 Members | 3,158 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HowTo: Read Sound Volume in RealTime

Hello,
when i play a sound file like mp3 or wav with MediaPlayer or anything like
this, i would like to get the volume level of the sound card in real time.
The data is then sent to the serial port. How do i get this data. I tried to
find some samples in msdn or internet but i couldn t find any useful code.
There is the winmm.dll which supports calls to waveIn and waveOut but all
the samples use them to set or get the master volume. That is not what i
need. I thought i found a sample in msdn, but this doesnt work. Can anybody
help me??
Nov 20 '05 #1
3 6735
Hi,

Maybe this will help. The class has some volume control method.
http://www.mentalis.org/soft/class.qpx?id=1

Ken
---------------------
"Andreas Hecker" <ah************ @htc-gmbh.de> wrote in message
news:OZ******** ******@tk2msftn gp13.phx.gbl...
Hello,
when i play a sound file like mp3 or wav with MediaPlayer or anything like
this, i would like to get the volume level of the sound card in real time.
The data is then sent to the serial port. How do i get this data. I tried
to
find some samples in msdn or internet but i couldn t find any useful code.
There is the winmm.dll which supports calls to waveIn and waveOut but all
the samples use them to set or get the master volume. That is not what i
need. I thought i found a sample in msdn, but this doesnt work. Can
anybody
help me??

Nov 20 '05 #2
Thank you Ken, but this class also uses the Properties to get or set the
master volume. They do not provide real time data. I know that there is a
way, because there is an ocx which shows as an real-time led but without
getting the data. Perhaps there is an other solution?
"Ken Tucker [MVP]" <vb***@bellsout h.net> schrieb im Newsbeitrag
news:O$******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

Maybe this will help. The class has some volume control method.
http://www.mentalis.org/soft/class.qpx?id=1

Ken
---------------------
"Andreas Hecker" <ah************ @htc-gmbh.de> wrote in message
news:OZ******** ******@tk2msftn gp13.phx.gbl...
Hello,
when i play a sound file like mp3 or wav with MediaPlayer or anything like this, i would like to get the volume level of the sound card in real time. The data is then sent to the serial port. How do i get this data. I tried to
find some samples in msdn or internet but i couldn t find any useful code. There is the winmm.dll which supports calls to waveIn and waveOut but all the samples use them to set or get the master volume. That is not what i
need. I thought i found a sample in msdn, but this doesnt work. Can
anybody
help me??


Nov 20 '05 #3
Hi, unfortunately I cannot offer a solution, but I think you're referring to
the output level, not the actualy volume of output, e.g. the amplitude of
the sound coming out the speaker at any one instant in time.

I tried doing this once, but I fell flat on my face as there was
limited/incomplete examples around the net, having said that, this was about
2 years ago, so you might want to check again.

Anywho, I eventually found that the most results tended around something
called a "VU Meter", or "audio level"

Happy Googling :)

--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
"Andreas Hecker" <ah************ @htc-gmbh.de> wrote in message
news:ef******** ******@TK2MSFTN GP10.phx.gbl...
Thank you Ken, but this class also uses the Properties to get or set the
master volume. They do not provide real time data. I know that there is a
way, because there is an ocx which shows as an real-time led but without
getting the data. Perhaps there is an other solution?
"Ken Tucker [MVP]" <vb***@bellsout h.net> schrieb im Newsbeitrag
news:O$******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

Maybe this will help. The class has some volume control method.
http://www.mentalis.org/soft/class.qpx?id=1

Ken
---------------------
"Andreas Hecker" <ah************ @htc-gmbh.de> wrote in message
news:OZ******** ******@tk2msftn gp13.phx.gbl...
Hello,
when i play a sound file like mp3 or wav with MediaPlayer or anything like this, i would like to get the volume level of the sound card in real time. The data is then sent to the serial port. How do i get this data. I tried to
find some samples in msdn or internet but i couldn t find any useful code. There is the winmm.dll which supports calls to waveIn and waveOut but all the samples use them to set or get the master volume. That is not what i need. I thought i found a sample in msdn, but this doesnt work. Can
anybody
help me??



Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2191
by: Keyser | last post by:
On most my pages, I use Javascript to play a sound. It works fine in Netscape 4.7, Netscape 7.2, Firefox 1.0, IE5 and IE6 using Windows98 as the operating system. However, using WindowsXP as the operating system, the entire Netscape 7.2 browser and Firefox 1.0 browser shuts down when I try to use the Back button on these pages. Is there some setting in Windows XP that is causing this or is there something I can add to the Javascript to...
4
3011
by: murrayatuptowngallery | last post by:
I have looked at some mouseover/ sound object scripts and can't get them to work. Most were more complex than needed and introduced several new parameters for me. I found a simple pair of html code segments that accomplish display of an image and automatic 'display' (playback) of a .wav file, and apparently are usable for both IE and NS, " <object height="100%" width="100%"
2
1671
by: scottech | last post by:
I'm not sure if this is the 'right' place to post -- I'm just getting used to the VB newsgroups, but I need assistance and am hoping I can either get the assistance or some help in pointing me the right direction. In any case, I have a basic question regarding the actual development interface, and in being able to control the sounds. The example: I use: Microsoft Visual Basic .NET, Microsoft Development Environment 2003
4
3483
by: Robert Gravereaux | last post by:
I'm putting together a C# .Net forms project on win2k. The application requires some sort of horn sound. I've never implemented any audio in .Net, so I'm not sure how best to accomplish this. It's an application that works with a wireless barcode scanner, in a warehouse environment. The user could be potentially 20 or 30 ft. from the PC. If the user scans something improperly, the app should sound a 'horn' to notify the user. I'm trying...
0
1294
by: =?Utf-8?B?TmljayBIb2x3YXk=?= | last post by:
I'm trying to follow a tutorial (1) on getting and setting a sound card's volume. It uses a function in winmm.dll public static extern int waveOutGetVolume(IntPtr hwo, out uint dwVolume); It uses waveOutGetVolume later to find the volume of the device:
3
2859
by: Memozio | last post by:
Is there a library in python that has methods applicable to volume(in terms of sound) of a given file? For example if it can check if the sound volume of a file is on the same level for the entire file duration?; or if the sound volume increases/decreases all the way through the entire file duration? Thank you Petro
0
4117
by: CharlesHawk | last post by:
Hi, Im trying to make a Guitar Tuner in C#, after this i want to try and use all i have learned and make a game like guitar hero with a real guitar :D but my problem is i dont know how to record sound in real time ? and get a value for the sound the value must be used to identify what has been pressed on the guitar, so for the tuner i want to have the app work like a normal guitar tuner What i need to do (and dont know how yet): *...
26
3906
by: Jake Barnes | last post by:
I did a search on the newsgroup comp.lang.javascript. I was searching for "how to play a sound with Javascript". I'm somewhat suprised that the majority of entries are from the 1990s, and there are almost no posts from the last 3 years: http://groups.google.com/group/comp.lang.javascript/search?group=comp.lang.javascript&q=how+to+play+a+sound+with+Javascript&qt_g=Search+this+group Even after sorting by date, there don't appear any...
4
4597
by: kid joe | last post by:
Hello I've got interested in learning some basic sound programming bits in C... mainly I want to know how to go about accessing the sound devices - reading from them mainly - in windows and linux... I'd kind of like to be able to do it without a whole bunch of extra garbage added in there - by this I mean that I know in windows there are a million sound programming packages that make the whole process "easier" - there are also a few in...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10470
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10247
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10214
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9067
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7561
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5583
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.