decibel

Get amplitude from MediaPlayer using Visualizer

寵の児 提交于 2021-02-07 17:24:27
问题 i've been reading another posts about calculate the amplitude in real time from a Mediaplayer, but i have no clear how to get a value useful for me. What i need is a linear amplitude value normalize between 0-100, but as i've watched in another posts they are performing a db calculation which has not much sense, cause they are not normalized to max 0dB value (from How to calculate the audio amplitude in real time (android)): double amplitude = 0; for (int i = 0; i < audioData.length/2; i++) {

Am I doing the right thing to convert decibel from -120 - 0 to 0 - 120

给你一囗甜甜゛ 提交于 2019-12-29 13:31:46
问题 I will like to measure the sound volume of the surrounding, not too sure if I am doing the right thing. I will like to create a VU meter of a range of 0(quiet) to 120(very noisy). I gotten the Peak and Avg power but are very high in normal quiet environment. Do give me some pointer. - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //creating an audio CAF file in the temporary directory, this isn’t ideal but it’s the only way

Get dB(a) level from AudioKit in swift

百般思念 提交于 2019-12-25 02:47:15
问题 I am attempting to get dB(A) readings from audio recorded from the microphone from AudioKit. I attempt to pass the amplitude tracker into the AKFFTTap object, but it always returns an array of zeros when I call AKFFTTap.fftData . Does anyone have experience with getting dB(A) values from AudioKit and the microphone. 来源: https://stackoverflow.com/questions/48813775/get-dba-level-from-audiokit-in-swift

How to calculate the decibel of audio signal and record the audio in java?

跟風遠走 提交于 2019-12-24 21:43:42
问题 public TargetDataLine targetDataLine; private static AudioFormat getAudioFormat() { return new AudioFormat(16000, 16, 2, true, false); } AudioFormat a = getAudioFormat(); DataLine.Info info = new DataLine.Info(TargetDataLine.class, a); targetDataLine = (TargetDataLine) AudioSystem.getLine(info); targetDataLine.open(a); targetDataLine.start(); AudioInputStream ais = new AudioInputStream(targetDataLine); AudioSystem.write(ais, AudioFileFormat.Type.WAVE, new File("record.wav")); How can i

From Amplitude or FFT to dB

假如想象 提交于 2019-12-23 00:26:49
问题 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

From Amplitude or FFT to dB

老子叫甜甜 提交于 2019-12-23 00:26:41
问题 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

How to get the reading of deciBels from iOS AVAudioRecorder in a correct scale?

烂漫一生 提交于 2019-12-20 09:43:20
问题 I'm trying to obtain a noise level in my iOS app, using AVAudioRecorder. The code I'm using is: [self.recorder updateMeters]; float decibels = [self.recorder averagePowerForChannel:0]; // 160+db here, to scale it from 0 to 160, not -160 to 0. decibels = 160+decibels; NSLog(@"Decibels: %.3f", decibels); The readings I get, when the phone sits on my desk are at about 90-100dB. I checked this this link and the table I saw there shows that: Vacuum Cleaner - 80dB Large Orchestra - 98dB Walkman at

getMaxAmplitude() always returns 0

对着背影说爱祢 提交于 2019-12-19 21:45:46
问题 I'm trying to get the Sound Level Pressure expressed in decibel but I always get 0 . (The output of the TextView is -Infinity but because log(0) = -infinity . public class SLP extends Activity{ TextView sound; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sound_activity); MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder

Decibels in android

梦想的初衷 提交于 2019-12-19 04:39:18
问题 I have created a application that get the getMaxAmpitude and then converts it to decibels but i only get a range of 30dB. Does an android phone only have a range of 30dB or is it a problem in my code? public class getMaxAmpitude extends AsyncTask<Void, Float, Void>{ String dB = ""; int ampitude; float db; @Override public Void doInBackground(Void... params) { while(rec == true){ try{ Thread.sleep(250); }catch(InterruptedException e){ e.printStackTrace(); } ampitude = recorder.getMaxAmplitude(

Decibels in android

烈酒焚心 提交于 2019-12-19 04:38:02
问题 I have created a application that get the getMaxAmpitude and then converts it to decibels but i only get a range of 30dB. Does an android phone only have a range of 30dB or is it a problem in my code? public class getMaxAmpitude extends AsyncTask<Void, Float, Void>{ String dB = ""; int ampitude; float db; @Override public Void doInBackground(Void... params) { while(rec == true){ try{ Thread.sleep(250); }catch(InterruptedException e){ e.printStackTrace(); } ampitude = recorder.getMaxAmplitude(