decibel

How to obtain accurate decibel level with Cocoa?

六月ゝ 毕业季﹏ 提交于 2019-12-04 13:49:57
问题 We are creating an application which records the surrounding sound and take necessary action if the sound crosses specified Decibel. In order to achieve the application objective we are using following method from AudioQueueObject.h - (void) getAudioLevels: (Float32 *) levels peakLevels: (Float32 *) peakLevels { UInt32 propertySize = audioFormat.mChannelsPerFrame * sizeof (AudioQueueLevelMeterState); AudioQueueGetProperty( self.queueObject, (AudioQueuePropertyID)kAudioQueueProperty

iPhone - AVAudioPlayer - convert decibel level into percent

元气小坏坏 提交于 2019-12-04 11:18:13
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 Several Apple examples use the following formula to convert the decibels into a linear range (from 0.0 to 1.0): double percentage = pow (10, (0.05 * power));

How to obtain accurate decibel level with Cocoa?

孤人 提交于 2019-12-03 08:45:12
We are creating an application which records the surrounding sound and take necessary action if the sound crosses specified Decibel. In order to achieve the application objective we are using following method from AudioQueueObject.h - (void) getAudioLevels: (Float32 *) levels peakLevels: (Float32 *) peakLevels { UInt32 propertySize = audioFormat.mChannelsPerFrame * sizeof (AudioQueueLevelMeterState); AudioQueueGetProperty( self.queueObject, (AudioQueuePropertyID)kAudioQueueProperty_CurrentLevelMeterDB, self.audioLevels, &propertySize); levels[0] = self.audioLevels[0].mAveragePower; peakLevels

How to get a volume measurement of iPhone recording in dB, with a limit of at least 120dB

南笙酒味 提交于 2019-12-03 07:54:36
问题 I am trying to make a simple volume meter for the iPhone. I want the volume to be displayed in dB. When using this turorial, I am only getting measurements up to 78 dB. I've read that that is because the dBFS spectrum for 16 bit audio recordings is only 96 dB. I tried modifying this piece of code in the init function: dataFormat.mSampleRate = 44100.0f; dataFormat.mFormatID = kAudioFormatLinearPCM; dataFormat.mFramesPerPacket = 1; dataFormat.mChannelsPerFrame = 1; dataFormat.mBytesPerFrame = 2

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

一世执手 提交于 2019-12-02 19:41:41
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 Maximum Level - 100dB Front Rows of Rock Concert - 110dB Now, however my office might seem to be a loud

Decibels in android

这一生的挚爱 提交于 2019-12-01 01:40:56
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(); db =(float) (20 * Math.log10(ampitude/700.0)); publishProgress(db); } return null; } public void

C# How to get Audio Decibel values with time span

一曲冷凌霜 提交于 2019-11-30 16:05:01
how can I get Decibel values of a wav/mp3 file I have every 1 second? using any audio library that works with C#.. something like: Time: 0, DB: 0.213623 Time: 1, DB: 0.2692261 Time: 2, DB: 0.2355957 Time: 3, DB: 0.2363281 Time: 4, DB: 0.3799744 Time: 5, DB: 0.3580322 Time: 6, DB: 0.1331177 Time: 7, DB: 0.3091431 Time: 8, DB: 0.2984009 I'd really appreciate your help :) regards, With NAudio you can use the WaveFileReader and Mp3FileReader classes to get access to the sample data within the file as a byte array. Then you would need to read through the file and get the sample values (e.g. for 16

Getting decibel from an Android microphone

天大地大妈咪最大 提交于 2019-11-30 04:07:20
I have been searching for quite some time now, and I haven't been able to find a way to actually get an SPL/db value from a microphone on Android. The few threads and articles that I have found that discussed it treated it like something so obvious that anyone should be able to do it, and were more concerned with getting their conversion algorithms correct. Does anyone know how to do this? You would have to first disable any automatic level control. I assume you either know, or know where to look to find out how to record samples from the microphone without ALC. From then on, its basically all

C# How to get Audio Decibel values with time span

我的未来我决定 提交于 2019-11-29 23:48:57
问题 how can I get Decibel values of a wav/mp3 file I have every 1 second? using any audio library that works with C#.. something like: Time: 0, DB: 0.213623 Time: 1, DB: 0.2692261 Time: 2, DB: 0.2355957 Time: 3, DB: 0.2363281 Time: 4, DB: 0.3799744 Time: 5, DB: 0.3580322 Time: 6, DB: 0.1331177 Time: 7, DB: 0.3091431 Time: 8, DB: 0.2984009 I'd really appreciate your help :) regards, 回答1: With NAudio you can use the WaveFileReader and Mp3FileReader classes to get access to the sample data within

Getting decibel from an Android microphone

雨燕双飞 提交于 2019-11-29 01:55:32
问题 I have been searching for quite some time now, and I haven't been able to find a way to actually get an SPL/db value from a microphone on Android. The few threads and articles that I have found that discussed it treated it like something so obvious that anyone should be able to do it, and were more concerned with getting their conversion algorithms correct. Does anyone know how to do this? 回答1: You would have to first disable any automatic level control. I assume you either know, or know