473,467 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

sound processing - avarage amplitude?

Hello

I would need way to check the amplitude (over time) for a sound file in
python. I'm sure this can be done, for example the audioop.rms function
seems to be able return amplitude values. However, it would be really
great to get the results in dB, which does not seem to be the case.
Anyone who has more information about this, or a way to convert the
results? I've searched google but info about audioop seem to be quite
scarce. Also, does audioop function perfectly also for wave files? Also,
cross-platform solutions are of course preferred, but I'm running linux
(with oss).

I've also looked somewhat into tkSnack (http://www.speech.kth.se/snack/)
which has a dBPowerSpectrum function which might be doing at least
partially what i want it to, however, the returned values are approx.
-100 ... which I find odd. The "real", recorded sound was somewhere in
the 50-60dB range.
thanks in advance
Jul 18 '05 #1
1 3198
On Sat, 19 Mar 2005 17:18:42 +0200, rumours say that Niklas Paro <np***@abo.fi>
might have written:
Hello

I would need way to check the amplitude (over time) for a sound file in
python. I'm sure this can be done, for example the audioop.rms function
seems to be able return amplitude values. However, it would be really
great to get the results in dB, which does not seem to be the case.
Anyone who has more information about this, or a way to convert the
results? I've searched google but info about audioop seem to be quite
scarce. Also, does audioop function perfectly also for wave files? Also,
cross-platform solutions are of course preferred, but I'm running linux
(with oss).
audioop is platform independent. You just might need to import wave also.
I've also looked somewhat into tkSnack (http://www.speech.kth.se/snack/)
which has a dBPowerSpectrum function which might be doing at least
partially what i want it to, however, the returned values are approx.
-100 ... which I find odd. The "real", recorded sound was somewhere in
the 50-60dB range.
Where is your 0dB mark? If it's at maximum amplitude (1), then any value
(except zero) can be expressed as (negative) dB by the following function:

def amp2dB(amplitude):
return 20*math.log(amplitude, 10)

If you're converting from the 0...32767 range of 16bit PCM files, first divide
the amplitude by 32767.0 and pass the result to amp2dB.
thanks in advance


Hope this helps.
--
TZOTZIOY, I speak England very best.
"Be strict when sending and tolerant when receiving." (from RFC1958)
I really should keep that in mind when talking with people, actually...
Jul 18 '05 #2

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

Similar topics

4
by: FLEB | last post by:
I've been trying to find a way to transfer session data (login information and such) between different domains, both on the same shared host. I think (I haven't tested yet, though) that using the...
5
by: Larry L | last post by:
I want to play a repetitive sound, and have a user click on a button each time it plays (say 5-10 times) and measure how far off he is from the sound each time. The only way I know to play a...
1
by: Marco Krechting | last post by:
Hi All, I have a database with the timer function set to warn the user that arecord is due to expire. Is there a Win API that I can use so a loud warning will go off. Not this simpel beep in...
1
by: Drygast | last post by:
I want to calculate the avarage time an order takes to complete. I put the dates into a accessdatabase (for instance "2003-10-15"), I would like to pull the dates into a form where I would like do...
3
by: Andreas Hecker | last post by:
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...
10
by: Immortalist | last post by:
Various aquisition devices that guide learning along particular pathways towards human biases. And as E.O. Wilson might say mental development appears to be genetically constrained. (1) Language...
4
by: sittner | last post by:
Hi everyone, I'm looking for a module for sound processing (manipulating sound objets, filters, ffts etc.). I tried Snack, but when i downloaded the package that was supposed to be for python,...
1
by: fdu.xiaojf | last post by:
Hi, When I was talking with my friend, I wanted to share the music I'm listening with my friend. I mean, I wanted my friend to hear my music and my own sound . I order to achieve this, I...
1
by: Anarhiztok | last post by:
Hello! I had to write some code for my homework, but i can't do one thing. I had to measure the phase characteristics of a circuit. I know i have to input a stereo signal - one line goes...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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 ...

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.