本文介绍了Android的 - 确定手机周围的声音水平的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想找出周围的噪音手机的水平。似乎没有成为一个简单的内置的方式做到这一点,让我发现了几个例子是说使用AudioRecord听很短的时间,然后用一个公式来获得分贝。我有几个问题,该文件似乎并没有太多的解释,虽然我不知道你是否一种民间能帮助我理解了。

I want to find out the level of noise around the phone. There doesn't seem to be an easy built-in way to do this, so I've found a few examples that say to use AudioRecord to listen for a brief time and then to use a formula to get the decibel. I have a few questions that the documentation doesn't seem much to explaining though and I was wondering if you kind folk could help me understand.


  1. 在什么阵列的俘虏? AudioRecord的通道类型,格式和采样率和存储需要一个几个参数信息到一个数组。我可以看到原始数字,但什么他们实际上意味着什么呢?

  1. What's captured in the Array? AudioRecord takes an several arguments on Channel type, format and sample rate and stores that information into an array. I can see the raw numbers, but what do they actually mean?

有没有资源,你可以点我,或者给我解释一下,如何将(我认为是)以字节形式的原始音频成分贝再presentation?

Is there a resource that your could point me to, or explain to me, on how to convert(what I assume to be) the raw audio in byte form into a decibel representation?

我不明白的部分是#1,什么是真正把数组中为止。任何帮助将是AP preciated。

The part I don't understand is #1, what is actually put in the array. Any help would be appreciated.

推荐答案

研究发现,声音的振幅转换为0-9范围内的麦克风一个很好的资源。
<一href=\"http://$c$c.google.com/p/android-labs/source/browse/trunk/NoiseAlert/src/com/google/android/noisealert/SoundMeter.java?r=2\">SoundMeter是由谷歌完成,作品不够好我的目的。

Found a great resource that converts to a 0-9 range the amplitude of the sound at the mic.SoundMeter is done by google and works well enough for my purpose.

这篇关于Android的 - 确定手机周围的声音水平的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 15:53
查看更多