decibel

Calculate Decibel from amplitude - Android media recorder

懵懂的女人 提交于 2019-12-18 03:03:54
问题 How to calculate decibel from maxAmplitude, I wrote an android application to get maxAmplitude at regular interval, I need to show the o/p to the user in decibels. 回答1: Decibels are a relative unit, they express the power of your signal relative to some reference power. If you are working with amplitudes, then the formula is: power_db = 20 * log10(amp / amp_ref); (See http://en.wikipedia.org/wiki/Decibel#Field_quantities). Note also that maximum amplitude is not usually a very good indicator

How to convert a float between -1.0 and +1.0 to dB(A) of sound pressure? [duplicate]

纵然是瞬间 提交于 2019-12-13 08:59:37
问题 This question already has answers here : How can I calculate audio dB level? (7 answers) Closed 4 years ago . Using WaveFileReader wfr = new WaveFileReader(file); float[] d = wfr.ReadNextSampleFrame(); I get a float array d . When iterating through d using foreach (float s in d) I get floats between -1.0 and +1.0. How do I convert them to dB(A) of sound pressure? EDIT: I solved it using double db = 20 * Math.Log10(Math.Abs(s)); 回答1: The dBA scale is a measure of relative air-pressure. In this

Decibel Meter using Media Recorder

喜夏-厌秋 提交于 2019-12-11 17:57:11
问题 I was referring to a code that I found previously and tried it myself. It works perfectly however the decibel measured from the code is extremely high even in a quiet room. The value ranged from 0 to 30000. I was expecting the decibel be around 30 ~ 40 when I am in a quiet room. Can someone please tell me what's wrong with the code? Maybe the algorithm in the code is wrong because "soundDB()" is not used. The decibel shown is the app is from "getAmplitudeEMA()" instead. import android.app

Android decibel meter

删除回忆录丶 提交于 2019-12-11 05:20:36
问题 I want to create an app that would be able to use the phone's microphone in order to get the outside noise volume in db. What is the easiest way to do it? 回答1: Check out one of the two projects on code.google.com: http://code.google.com/p/moonblink/wiki/Audalyzer http://code.google.com/p/splmeter/ where as the last projects used this formular for calculating the sound pressure value: http://en.wikipedia.org/wiki/Sound_pressure 来源: https://stackoverflow.com/questions/8288813/android-decibel

How do you get the decibel level of an audio in Javascript

早过忘川 提交于 2019-12-10 17:26:25
问题 I am currently making a decibel meter visualizer using JavaScript, HTML and CSS. I have gone through several Web Audio API tutorials, but nothing on there is close to being specific to what I want to do. This is what I have so far: window.onload = init; function init() { var ctx = new webkitAudioContext() , url = 'https://dl.dropboxusercontent.com/u/86176287/pbjt.mp3' , audio = new Audio(url) // 2048 sample buffer, 1 channel in, 1 channel out , processor = ctx.createJavaScriptNode(2048, 1, 1)

Confusion with meters in AVAudioRecorder

浪子不回头ぞ 提交于 2019-12-10 16:53:46
问题 Simply put, I'm trying to lip-sync something based on the decibel reading from the mic input stream of an iPhone, and the values I'm getting aren't quite what I'm after. I'm using AVAudioRecorder's peakPowerForChannel and averagePowerForChannel. (I'm aware that this is a rather simplistic lip-sync technique, but quality isn't a major concern). When the number of decibels increases, the meters react as I'd like them to (higher value when louder, so I can map this to the open-ness of the mouth)

Android: Amplitude value to Decibel value?

杀马特。学长 韩版系。学妹 提交于 2019-12-09 06:44:38
问题 I'm trying to get the decibel of noise being recored from mic on Android phone. I can get amplitude value and looking for the formula to convert it into decibel. I use following function of MediaRecorder to get amplitude. mediaRecorder.getMaxAmplitude() ; In another question I found the following formula. power_db = 20 * log10(amp / amp_ref); amp is amplitude but not sure what's amp_ref . Is there anyone knows the correct formula? 回答1: i think that is the correct formula. amp_ref is reference

Android: record decibel from microphone

荒凉一梦 提交于 2019-12-08 12:22:55
问题 i've got problem on implementing this functionality in Android... i need only to output the decibel redorded from the microphone, and it's a thing that i can't understand: public class Noise extends Activity{ @Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); MediaRecorder recorder=new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); Timer timer=new Timer(); timer.scheduleAtFixedRate(new RecorderTask(recorder), 0, 500); }

From Amplitude or FFT to dB

五迷三道 提交于 2019-12-06 14:31:14
I've a Python code which performs FFT on a wav file and plot the amplitude vs time / amplitude vs freq graphs. I want to calculate dB from these graphs (they are long arrays). I do not want to calculate exact dBA, I just want to see a linear relationship after my calculations. I've dB meter, I will compare it. Here is my code: #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import scipy.io.wavfile as wavfile import scipy import scipy.fftpack import numpy as np from matplotlib import pyplot as plt fs_rate, signal = wavfile.read("output.wav") print ("Frequency

iPhone - AVAudioPlayer - convert decibel level into percent

旧巷老猫 提交于 2019-12-06 05:31:22
问题 I like to update an existing iPhone application which is using AudioQueue for playing audio files. The levels (peakPowerForChannel, averagePowerForChannel) were linear form 0.0f to 1.0f. Now I like to use the simpler class AVAudioPlayer which works fine, the only issue is that the levels which are now in decibel, not linear from -120.0f to 0.0f. Has anyone a formula to convert it back to the linear values between 0.0f and 1.0f? Thanks Tom 回答1: Several Apple examples use the following formula