├── LICENSE ├── README.md ├── app ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── bodekjan │ │ └── soundmeter │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ └── fonts │ │ │ ├── ALKATIP.TTF │ │ │ └── Let_s go Digital Regular.ttf │ ├── java │ │ └── com │ │ │ └── bodekjan │ │ │ └── soundmeter │ │ │ ├── FileUtil.java │ │ │ ├── InfoDialog.java │ │ │ ├── MainActivity.java │ │ │ ├── MyMediaRecorder.java │ │ │ ├── Speedometer.java │ │ │ └── World.java │ └── res │ │ ├── anim │ │ └── cycle.xml │ │ ├── drawable-hdpi │ │ ├── question.png │ │ └── refresh.png │ │ ├── drawable-mdpi │ │ ├── question.png │ │ └── refresh.png │ │ ├── drawable-nodpi │ │ ├── egg.png │ │ ├── logo.png │ │ ├── noise_disc.png │ │ ├── noise_index.png │ │ ├── question.png │ │ ├── refresh.png │ │ └── texture.png │ │ ├── drawable-xhdpi │ │ ├── question.png │ │ └── refresh.png │ │ ├── drawable │ │ ├── bg_dialog.xml │ │ └── bg_page.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ └── dialog_info.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-fr │ │ └── strings.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ ├── values-zh │ │ └── strings.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── bodekjan │ └── soundmeter │ └── ExampleUnitTest.java ├── build.gradle ├── fastlane └── metadata │ └── android │ ├── en-US │ ├── full_description.txt │ └── images │ │ ├── icon.png │ │ └── phoneScreenshots │ │ └── sm_en.jpg │ └── fr-FR │ └── images │ ├── icon.png │ └── phoneScreenshots │ └── sm_en.jpg ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── local.properties ├── screenshots ├── sm_en.jpg ├── sm_fr.jpg └── sm_zh.jpg └── settings.gradle /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sound-Meter 2 | Sound-meter is an android application that measures sound level in decibel
3 | 4 | ![image](https://github.com/jeff2900/Sound-Meter/blob/master/screenshots/sm_en.jpg)
5 |
6 | Based on halibobo's project 7 | https://github.com/halibobo/SoundMeter
8 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | namespace "com.bodekjan.soundmeter" 5 | compileSdkVersion 34 6 | 7 | defaultConfig { 8 | applicationId "com.bodekjan.soundmeter" 9 | minSdkVersion 21 10 | targetSdkVersion 34 11 | versionCode 141 12 | versionName "1.4.1" 13 | } 14 | lintOptions { 15 | abortOnError false 16 | } 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | repositories { 24 | maven { url "https://jitpack.io" } 25 | } 26 | dependenciesInfo { 27 | // Disables dependency metadata when building APKs. 28 | includeInApk = false 29 | // Disables dependency metadata when building Android App Bundles. 30 | includeInBundle = false 31 | } 32 | } 33 | 34 | dependencies { 35 | implementation fileTree(dir: 'libs', include: ['*.jar']) 36 | testImplementation 'junit:junit:4.12' 37 | implementation('androidx.appcompat:appcompat:1.5.1') 38 | implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0' 39 | implementation 'com.github.neopixl:PixlUI:v1.1.0' 40 | } 41 | 42 | java { 43 | toolchain { 44 | languageVersion = JavaLanguageVersion.of(17) 45 | } 46 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\bodekjan\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/bodekjan/soundmeter/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.bodekjan.soundmeter; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/assets/fonts/ALKATIP.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/assets/fonts/ALKATIP.TTF -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Let_s go Digital Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/assets/fonts/Let_s go Digital Regular.ttf -------------------------------------------------------------------------------- /app/src/main/java/com/bodekjan/soundmeter/FileUtil.java: -------------------------------------------------------------------------------- 1 | package com.bodekjan.soundmeter; 2 | 3 | import android.content.Context; 4 | import android.os.Environment; 5 | 6 | import java.io.File; 7 | import java.io.IOException; 8 | 9 | /** 10 | * Created by bodekjan on 2016/8/8. 11 | */ 12 | public class FileUtil { 13 | private static final String TAG = "FileUtil"; 14 | 15 | private FileUtil() { 16 | } 17 | 18 | /** 19 | * To determine whether there is storage space * 20 | * 21 | * @return 22 | */ 23 | public static boolean isExitSDCard() { 24 | return Environment.getExternalStorageState().equals( 25 | Environment.MEDIA_MOUNTED); 26 | } 27 | 28 | private static boolean hasFile(Context context, String fileName) { 29 | File f = createFile(context, fileName); 30 | return null != f && f.exists(); 31 | } 32 | 33 | public static File createFile(Context context, String fileName) { 34 | File myCaptureFile = new File(context.getFilesDir(), fileName); 35 | if (myCaptureFile.exists()) { 36 | myCaptureFile.delete(); 37 | } 38 | try { 39 | myCaptureFile.createNewFile(); 40 | } catch (IOException e) { 41 | e.printStackTrace(); 42 | } 43 | return myCaptureFile; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/bodekjan/soundmeter/InfoDialog.java: -------------------------------------------------------------------------------- 1 | package com.bodekjan.soundmeter; 2 | 3 | import android.app.Dialog; 4 | import android.content.Context; 5 | import android.content.DialogInterface; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.widget.Button; 9 | import android.widget.LinearLayout; 10 | import android.widget.TextView; 11 | 12 | /** 13 | * Created by bodekjan on 2016/8/8. 14 | */ 15 | public class InfoDialog extends Dialog { 16 | 17 | public InfoDialog(Context context) { 18 | super(context); 19 | } 20 | 21 | public InfoDialog(Context context, int theme) { 22 | super(context, theme); 23 | } 24 | 25 | public static class Builder { 26 | private Context context; 27 | private String title; 28 | private String message; 29 | private String negativeButtonText; 30 | private View contentView; 31 | private DialogInterface.OnClickListener negativeButtonClickListener; 32 | 33 | public Builder(Context context) { 34 | this.context = context; 35 | } 36 | 37 | public Builder setMessage(String message) { 38 | this.message = message; 39 | return this; 40 | } 41 | 42 | /** 43 | * Set the Dialog message from resource 44 | * 45 | * @return 46 | */ 47 | public Builder setMessage(int message) { 48 | this.message = (String) context.getText(message); 49 | return this; 50 | } 51 | 52 | /** 53 | * Set the Dialog title from resource 54 | * 55 | * @param title 56 | * @return 57 | */ 58 | public Builder setTitle(int title) { 59 | this.title = (String) context.getText(title); 60 | return this; 61 | } 62 | 63 | /** 64 | * Set the Dialog title from String 65 | * 66 | * @param title 67 | * @return 68 | */ 69 | 70 | public Builder setTitle(String title) { 71 | this.title = title; 72 | return this; 73 | } 74 | 75 | public Builder setContentView(View v) { 76 | this.contentView = v; 77 | return this; 78 | } 79 | 80 | public Builder setNegativeButton(int negativeButtonText, 81 | DialogInterface.OnClickListener listener) { 82 | this.negativeButtonText = (String) context 83 | .getText(negativeButtonText); 84 | this.negativeButtonClickListener = listener; 85 | return this; 86 | } 87 | 88 | public Builder setNegativeButton(String negativeButtonText, 89 | DialogInterface.OnClickListener listener) { 90 | this.negativeButtonText = negativeButtonText; 91 | this.negativeButtonClickListener = listener; 92 | return this; 93 | } 94 | 95 | public InfoDialog create() { 96 | LayoutInflater inflater = (LayoutInflater) context 97 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE); 98 | // instantiate the dialog with the custom Theme 99 | final InfoDialog dialog = new InfoDialog(context, R.style.Dialog); 100 | View layout = inflater.inflate(R.layout.dialog_info, null); 101 | dialog.addContentView(layout, new LinearLayout.LayoutParams( 102 | LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); 103 | // set the dialog title 104 | ((TextView) layout.findViewById(R.id.title)).setText(title); 105 | // set the cancel button 106 | if (negativeButtonText != null) { 107 | ((Button) layout.findViewById(R.id.negativeButton)) 108 | .setText(negativeButtonText); 109 | if (negativeButtonClickListener != null) { 110 | ((Button) layout.findViewById(R.id.negativeButton)) 111 | .setOnClickListener(new View.OnClickListener() { 112 | public void onClick(View v) { 113 | negativeButtonClickListener.onClick(dialog, 114 | DialogInterface.BUTTON_NEGATIVE); 115 | } 116 | }); 117 | } 118 | } else { 119 | // if no confirm button just set the visibility to GONE 120 | layout.findViewById(R.id.negativeButton).setVisibility( 121 | View.GONE); 122 | } 123 | // set the content message 124 | if (message != null) { 125 | //((TextView) layout.findViewById(R.id.message)).setText(message); 126 | } else if (contentView != null) { 127 | // if no message set 128 | // add the contentView to the dialog body 129 | ((LinearLayout) layout.findViewById(R.id.content)) 130 | .removeAllViews(); 131 | ((LinearLayout) layout.findViewById(R.id.content)) 132 | .addView(contentView, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT)); 133 | } 134 | dialog.setContentView(layout); 135 | return dialog; 136 | } 137 | } 138 | } -------------------------------------------------------------------------------- /app/src/main/java/com/bodekjan/soundmeter/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.bodekjan.soundmeter; 2 | 3 | import android.Manifest; 4 | import android.app.Activity; 5 | import android.content.DialogInterface; 6 | import android.content.pm.ActivityInfo; 7 | import android.content.pm.PackageManager; 8 | import android.graphics.Color; 9 | import android.graphics.Typeface; 10 | import android.os.Build; 11 | import android.os.Handler; 12 | import android.os.Message; 13 | import android.os.Bundle; 14 | import android.view.View; 15 | import android.view.Window; 16 | import android.view.WindowManager; 17 | import android.widget.ImageButton; 18 | import android.widget.TextView; 19 | import android.widget.Toast; 20 | 21 | import com.github.mikephil.charting.charts.LineChart; 22 | import com.github.mikephil.charting.components.Description; 23 | import com.github.mikephil.charting.components.XAxis; 24 | import com.github.mikephil.charting.components.YAxis; 25 | import com.github.mikephil.charting.data.Entry; 26 | import com.github.mikephil.charting.data.LineData; 27 | import com.github.mikephil.charting.data.LineDataSet; 28 | import com.github.mikephil.charting.formatter.IFillFormatter; 29 | import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider; 30 | import com.github.mikephil.charting.interfaces.datasets.ILineDataSet; 31 | 32 | import java.io.File; 33 | import java.text.DecimalFormat; 34 | import java.util.ArrayList; 35 | import java.util.Date; 36 | 37 | public class MainActivity extends Activity { 38 | ArrayList yVals; 39 | boolean refreshed=false; 40 | Speedometer speedometer; 41 | public static Typeface tf; 42 | ImageButton infoButton; 43 | ImageButton refreshButton; 44 | LineChart mChart; 45 | TextView minVal; 46 | TextView maxVal; 47 | TextView mmVal; 48 | TextView curVal; 49 | long currentTime=0; 50 | long savedTime=0; 51 | boolean isChart=false; 52 | boolean isMoney=false; 53 | /* Decibel */ 54 | private boolean bListener = true; 55 | private boolean isThreadRun = true; 56 | private Thread thread; 57 | float volume = 10000; 58 | int refresh=0; 59 | private MyMediaRecorder mRecorder ; 60 | 61 | final Handler handler = new Handler(){ 62 | @Override 63 | public void handleMessage(Message msg){ 64 | super.handleMessage(msg); 65 | DecimalFormat df1 = new DecimalFormat("####.0"); 66 | if(msg.what == 1){ 67 | if(!isChart){ 68 | initChart(); 69 | return; 70 | } 71 | speedometer.refresh(); 72 | minVal.setText(df1.format(World.minDB)); 73 | mmVal.setText(df1.format((World.minDB+World.maxDB)/2)); 74 | maxVal.setText(df1.format(World.maxDB)); 75 | curVal.setText(df1.format(World.dbCount)); 76 | updateData(World.dbCount,0); 77 | if(refresh==1){ 78 | long now=new Date().getTime(); 79 | now=now-currentTime; 80 | now=now/1000; 81 | refresh=0; 82 | }else { 83 | refresh++; 84 | } 85 | } 86 | } 87 | }; 88 | @Override 89 | protected void onCreate(Bundle savedInstanceState) { 90 | super.onCreate(savedInstanceState); 91 | setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); 92 | getWindow().requestFeature(Window.FEATURE_NO_TITLE); 93 | if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 94 | Window window = getWindow(); 95 | window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS 96 | | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); 97 | window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN 98 | | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION 99 | | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); 100 | window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); 101 | window.setStatusBarColor(Color.TRANSPARENT); 102 | window.setNavigationBarColor(Color.TRANSPARENT); 103 | } 104 | boolean isAudioRecord = isRecordAudioPermissionGranted(); 105 | setContentView(R.layout.activity_main); 106 | tf= Typeface.createFromAsset(this.getAssets(), "fonts/Let_s go Digital Regular.ttf"); 107 | minVal=(TextView)findViewById(R.id.minval);minVal.setTypeface(tf); 108 | mmVal=(TextView)findViewById(R.id.mmval);mmVal.setTypeface(tf); 109 | maxVal=(TextView)findViewById(R.id.maxval);maxVal.setTypeface(tf); 110 | curVal=(TextView)findViewById(R.id.curval);curVal.setTypeface(tf); 111 | infoButton=(ImageButton)findViewById(R.id.infobutton); 112 | infoButton.setOnClickListener(new View.OnClickListener() { 113 | @Override 114 | public void onClick(View view) { 115 | InfoDialog.Builder builder = new InfoDialog.Builder(MainActivity.this); 116 | builder.setMessage(getString(R.string.activity_infobull)); 117 | builder.setTitle(getString(R.string.activity_infotitle)); 118 | builder.setNegativeButton(getString(R.string.activity_infobutton), 119 | new android.content.DialogInterface.OnClickListener() { 120 | public void onClick(DialogInterface dialog, int which) { 121 | dialog.dismiss(); 122 | } 123 | }); 124 | builder.create().show(); 125 | } 126 | }); 127 | refreshButton=(ImageButton)findViewById(R.id.refreshbutton); 128 | refreshButton.setOnClickListener(new View.OnClickListener() { 129 | @Override 130 | public void onClick(View view) { 131 | refreshed=true; 132 | World.minDB=100; 133 | World.dbCount=0; 134 | World.lastDbCount=0; 135 | World.maxDB=0; 136 | initChart(); 137 | } 138 | }); 139 | 140 | speedometer=(Speedometer)findViewById(R.id.speed); 141 | mRecorder = new MyMediaRecorder(); 142 | } 143 | 144 | private void updateData(float val, long time) { 145 | if(mChart==null){ 146 | return; 147 | } 148 | if (mChart.getData() != null && 149 | mChart.getData().getDataSetCount() > 0) { 150 | LineDataSet set1 = (LineDataSet)mChart.getData().getDataSetByIndex(0); 151 | set1.setValues(yVals); 152 | Entry entry=new Entry(savedTime,val); 153 | set1.addEntry(entry); 154 | if(set1.getEntryCount()>200){ 155 | set1.removeFirst(); 156 | set1.setDrawFilled(false); 157 | } 158 | mChart.getData().notifyDataChanged(); 159 | mChart.notifyDataSetChanged(); 160 | mChart.invalidate(); 161 | savedTime++; 162 | } 163 | } 164 | private void initChart() { 165 | if(mChart!=null){ 166 | if (mChart.getData() != null && 167 | mChart.getData().getDataSetCount() > 0) { 168 | savedTime++; 169 | isChart=true; 170 | } 171 | }else{ 172 | currentTime=new Date().getTime(); 173 | mChart = (LineChart) findViewById(R.id.chart1); 174 | mChart.setViewPortOffsets(50, 20, 5, 60); 175 | // no description text 176 | Description desc = new Description(); 177 | desc.setText(""); 178 | mChart.setDescription(desc); 179 | // enable touch gestures 180 | mChart.setTouchEnabled(true); 181 | // enable scaling and dragging 182 | mChart.setDragEnabled(false); 183 | mChart.setScaleEnabled(true); 184 | // if disabled, scaling can be done on x- and y-axis separately 185 | mChart.setPinchZoom(false); 186 | mChart.setDrawGridBackground(false); 187 | //mChart.setMaxHighlightDistance(400); 188 | XAxis x = mChart.getXAxis(); 189 | x.setLabelCount(8, false); 190 | x.setEnabled(true); 191 | x.setTypeface(tf); 192 | x.setTextColor(Color.GREEN); 193 | x.setPosition(XAxis.XAxisPosition.BOTTOM); 194 | x.setDrawGridLines(true); 195 | x.setAxisLineColor(Color.GREEN); 196 | YAxis y = mChart.getAxisLeft(); 197 | y.setLabelCount(6, false); 198 | y.setTextColor(Color.GREEN); 199 | y.setTypeface(tf); 200 | y.setPosition(YAxis.YAxisLabelPosition.OUTSIDE_CHART); 201 | y.setDrawGridLines(false); 202 | y.setAxisLineColor(Color.GREEN); 203 | y.setAxisMinValue(0); 204 | y.setAxisMaxValue(120); 205 | mChart.getAxisRight().setEnabled(true); 206 | yVals = new ArrayList(); 207 | yVals.add(new Entry(0,0)); 208 | LineDataSet set1 = new LineDataSet(yVals, "DataSet 1"); 209 | set1.setValueTypeface(tf); 210 | set1.setMode(LineDataSet.Mode.CUBIC_BEZIER); 211 | set1.setCubicIntensity(0.02f); 212 | set1.setDrawFilled(true); 213 | set1.setDrawCircles(false); 214 | set1.setCircleColor(Color.GREEN); 215 | set1.setHighLightColor(Color.rgb(244, 117, 117)); 216 | set1.setColor(Color.GREEN); 217 | set1.setFillColor(Color.GREEN); 218 | set1.setFillAlpha(100); 219 | set1.setDrawHorizontalHighlightIndicator(false); 220 | set1.setFillFormatter(new IFillFormatter() { 221 | @Override 222 | public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) { 223 | return -10; 224 | } 225 | }); 226 | LineData data; 227 | if (mChart.getData() != null && 228 | mChart.getData().getDataSetCount() > 0) { 229 | data = mChart.getLineData(); 230 | data.clearValues(); 231 | data.removeDataSet(0); 232 | data.addDataSet(set1); 233 | }else { 234 | data = new LineData(set1); 235 | } 236 | 237 | data.setValueTextSize(9f); 238 | data.setDrawValues(false); 239 | mChart.setData(data); 240 | mChart.getLegend().setEnabled(false); 241 | mChart.animateXY(2000, 2000); 242 | // dont forget to refresh the drawing 243 | mChart.invalidate(); 244 | isChart=true; 245 | } 246 | 247 | } 248 | /* Sub-chant analysis */ 249 | private void startListenAudio() { 250 | thread = new Thread(new Runnable() { 251 | @Override 252 | public void run() { 253 | while (isThreadRun) { 254 | try { 255 | if(bListener) { 256 | volume = mRecorder.getMaxAmplitude(); //Get the sound pressure value 257 | if(volume > 0 && volume < 1000000) { 258 | World.setDbCount(20 * (float)(Math.log10(volume))); //Change the sound pressure value to the decibel value 259 | // Update with thread 260 | Message message = new Message(); 261 | message.what = 1; 262 | handler.sendMessage(message); 263 | } 264 | } 265 | if(refreshed){ 266 | Thread.sleep(1200); 267 | refreshed=false; 268 | }else{ 269 | Thread.sleep(200); 270 | } 271 | } catch (InterruptedException e) { 272 | e.printStackTrace(); 273 | bListener = false; 274 | } 275 | } 276 | } 277 | }); 278 | thread.start(); 279 | } 280 | /** 281 | * Start recording 282 | * @param fFile 283 | */ 284 | public void startRecord(File fFile){ 285 | try{ 286 | mRecorder.setMyRecAudioFile(fFile); 287 | if (mRecorder.startRecorder()) { 288 | startListenAudio(); 289 | }else{ 290 | Toast.makeText(this, getString(R.string.activity_recStartErr), Toast.LENGTH_SHORT).show(); 291 | } 292 | }catch(Exception e){ 293 | Toast.makeText(this, getString(R.string.activity_recBusyErr), Toast.LENGTH_SHORT).show(); 294 | e.printStackTrace(); 295 | } 296 | } 297 | @Override 298 | protected void onResume() { 299 | super.onResume(); 300 | File file = FileUtil.createFile(getApplicationContext(),"temp.amr"); 301 | if (file != null) { 302 | startRecord(file); 303 | } else { 304 | Toast.makeText(getApplicationContext(), getString(R.string.activity_recFileErr), Toast.LENGTH_LONG).show(); 305 | } 306 | bListener = true; 307 | } 308 | 309 | /** 310 | * Stop recording 311 | */ 312 | @Override 313 | protected void onPause() { 314 | super.onPause(); 315 | bListener = false; 316 | mRecorder.delete(); //Stop recording and delete the recording file 317 | thread = null; 318 | isChart=false; 319 | } 320 | 321 | @Override 322 | protected void onDestroy() { 323 | if (thread != null) { 324 | isThreadRun = false; 325 | thread = null; 326 | } 327 | mRecorder.delete(); 328 | super.onDestroy(); 329 | } 330 | 331 | //Create placeholder for user's consent to record_audio permission. 332 | private boolean isRecordAudioPermissionGranted() 333 | { 334 | int AUDIO_RECORD_REQUEST_CODE = 1; 335 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 336 | if (checkSelfPermission(Manifest.permission.RECORD_AUDIO) == 337 | PackageManager.PERMISSION_GRANTED) { 338 | // put your code for Version>=Marshmallow 339 | return true; 340 | } else { 341 | if (shouldShowRequestPermissionRationale(Manifest.permission.RECORD_AUDIO)) { 342 | Toast.makeText(this, 343 | "App required access to audio", Toast.LENGTH_SHORT).show(); 344 | } 345 | requestPermissions(new String[]{Manifest.permission.RECORD_AUDIO 346 | },AUDIO_RECORD_REQUEST_CODE); 347 | return false; 348 | } 349 | 350 | } else { 351 | // put your code for Version < Marshmallow 352 | return true; 353 | } 354 | } 355 | } 356 | 357 | -------------------------------------------------------------------------------- /app/src/main/java/com/bodekjan/soundmeter/MyMediaRecorder.java: -------------------------------------------------------------------------------- 1 | package com.bodekjan.soundmeter; 2 | 3 | import android.media.MediaRecorder; 4 | 5 | import java.io.File; 6 | import java.io.IOException; 7 | 8 | /** 9 | * Created by bodekjan on 2016/8/8. 10 | */ 11 | public class MyMediaRecorder { 12 | public File myRecAudioFile ; 13 | private MediaRecorder mMediaRecorder ; 14 | public boolean isRecording = false ; 15 | 16 | public float getMaxAmplitude() { 17 | if (mMediaRecorder != null) { 18 | try { 19 | return mMediaRecorder.getMaxAmplitude(); 20 | } catch (IllegalArgumentException e) { 21 | e.printStackTrace(); 22 | return 0; 23 | } 24 | } else { 25 | return 5; 26 | } 27 | } 28 | 29 | public File getMyRecAudioFile() { 30 | return myRecAudioFile; 31 | } 32 | 33 | public void setMyRecAudioFile(File myRecAudioFile) { 34 | this.myRecAudioFile = myRecAudioFile; 35 | } 36 | 37 | /** 38 | * Recording 39 | * @return Whether to start recording successfully 40 | */ 41 | public boolean startRecorder(){ 42 | if (myRecAudioFile == null) { 43 | return false; 44 | } 45 | try { 46 | mMediaRecorder = new MediaRecorder(); 47 | 48 | mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); 49 | mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); 50 | mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); 51 | mMediaRecorder.setOutputFile(myRecAudioFile.getAbsolutePath()); 52 | 53 | mMediaRecorder.prepare(); 54 | mMediaRecorder.start(); 55 | isRecording = true; 56 | return true; 57 | } catch(IOException exception) { 58 | mMediaRecorder.reset(); 59 | mMediaRecorder.release(); 60 | mMediaRecorder = null; 61 | isRecording = false ; 62 | exception.printStackTrace(); 63 | }catch(IllegalStateException e){ 64 | stopRecording(); 65 | e.printStackTrace(); 66 | isRecording = false ; 67 | } 68 | return false; 69 | } 70 | 71 | public void stopRecording() { 72 | if (mMediaRecorder != null){ 73 | if(isRecording){ 74 | try{ 75 | mMediaRecorder.stop(); 76 | mMediaRecorder.release(); 77 | }catch(Exception e){ 78 | e.printStackTrace(); 79 | } 80 | } 81 | mMediaRecorder = null; 82 | isRecording = false ; 83 | } 84 | } 85 | 86 | public void delete() { 87 | stopRecording(); 88 | if (myRecAudioFile != null) { 89 | myRecAudioFile.delete(); 90 | myRecAudioFile = null; 91 | } 92 | } 93 | } -------------------------------------------------------------------------------- /app/src/main/java/com/bodekjan/soundmeter/Speedometer.java: -------------------------------------------------------------------------------- 1 | package com.bodekjan.soundmeter; 2 | 3 | import android.content.Context; 4 | import android.graphics.Bitmap; 5 | import android.graphics.BitmapFactory; 6 | import android.graphics.Canvas; 7 | import android.graphics.Color; 8 | import android.graphics.Matrix; 9 | import android.graphics.Paint; 10 | import android.util.AttributeSet; 11 | import android.widget.ImageView; 12 | 13 | /** 14 | * Created by bodekjan on 2016/8/8. 15 | */ 16 | public class Speedometer extends ImageView { 17 | 18 | private float scaleWidth, scaleHeight; 19 | private int newWidth, newHeight; 20 | private Matrix mMatrix = new Matrix(); 21 | private Bitmap indicatorBitmap; 22 | private Paint paint = new Paint(); 23 | static final long ANIMATION_INTERVAL = 20; 24 | 25 | public Speedometer(Context context) { 26 | super(context); 27 | } 28 | 29 | public Speedometer(Context context, AttributeSet attrs) { 30 | super(context, attrs); 31 | } 32 | 33 | private void init() { 34 | Bitmap myBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.noise_index); 35 | int bitmapWidth = myBitmap.getWidth(); 36 | int bitmapHeight = myBitmap.getHeight(); 37 | newWidth = getWidth(); 38 | newHeight = getHeight(); 39 | scaleWidth = ((float) newWidth) /(float) bitmapWidth; // Get the zoom ratio 40 | scaleHeight = ((float) newHeight) /(float) bitmapHeight; //Get the zoom ratio 41 | mMatrix.postScale(scaleWidth, scaleHeight); //Set the scale of mMatrix 42 | indicatorBitmap = Bitmap.createBitmap(myBitmap, 0, 0, bitmapWidth, bitmapHeight, mMatrix,true); //Get the same and background width and height of the pointer map bitmap 43 | 44 | paint = new Paint(); 45 | paint.setTextSize(44); 46 | paint.setTypeface(MainActivity.tf); 47 | paint.setAntiAlias(true); //Anti-aliasing 48 | paint.setTextAlign(Paint.Align.CENTER); 49 | paint.setColor(Color.WHITE); 50 | } 51 | 52 | public void refresh() { 53 | postInvalidateDelayed(ANIMATION_INTERVAL); //Sub-thread refresh view 54 | } 55 | 56 | @Override 57 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 58 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 59 | } 60 | 61 | @Override 62 | protected void onDraw(Canvas canvas) { 63 | super.onDraw(canvas); 64 | if (indicatorBitmap == null) { 65 | init(); 66 | } 67 | mMatrix.setRotate(getAngle(World.dbCount), newWidth / 2, newHeight * 215 / 460); //The relative position of the sheet 68 | canvas.drawBitmap(indicatorBitmap, mMatrix, paint); 69 | canvas.drawText((int)World.dbCount+" DB", newWidth/2,newHeight*36/46, paint); //Picture relative position 70 | } 71 | 72 | private float getAngle(float db){ 73 | return(db-85)*5/3; //Say more are tears, online to find pictures. The They will not change the map, the code calculation 74 | } 75 | } -------------------------------------------------------------------------------- /app/src/main/java/com/bodekjan/soundmeter/World.java: -------------------------------------------------------------------------------- 1 | package com.bodekjan.soundmeter; 2 | 3 | import android.util.Log; 4 | 5 | /** 6 | * Created by bodekjan on 2016/8/8. 7 | */ 8 | public class World { 9 | public static float dbCount = 40; 10 | public static float minDB =100; 11 | public static float maxDB =0; 12 | public static float lastDbCount = dbCount; 13 | private static float min = 0.5f; //Set the minimum sound change 14 | private static float value = 0; // Sound decibel value 15 | public static void setDbCount(float dbValue) { 16 | if (dbValue > lastDbCount) { 17 | value = dbValue - lastDbCount > min ? dbValue - lastDbCount : min; 18 | }else{ 19 | value = dbValue - lastDbCount < -min ? dbValue - lastDbCount : -min; 20 | } 21 | dbCount = lastDbCount + value * 0.2f ; //To prevent the sound from changing too fast 22 | lastDbCount = dbCount; 23 | if(dbCountmaxDB) maxDB=dbCount; 25 | } 26 | } -------------------------------------------------------------------------------- /app/src/main/res/anim/cycle.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/drawable-hdpi/question.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/drawable-hdpi/refresh.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/drawable-mdpi/question.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/drawable-mdpi/refresh.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/egg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/drawable-nodpi/egg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/drawable-nodpi/logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/noise_disc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/drawable-nodpi/noise_disc.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/noise_index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/drawable-nodpi/noise_index.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/drawable-nodpi/question.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/drawable-nodpi/refresh.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/drawable-nodpi/texture.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/drawable-xhdpi/question.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/drawable-xhdpi/refresh.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_page.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 23 | 24 | 33 | 34 | 43 | 44 | 55 | 56 | 57 | 64 | 65 | 70 | 71 | 78 | 79 | 86 | 87 | 88 | 93 | 94 | 101 | 102 | 109 | 110 | 111 | 116 | 117 | 124 | 125 | 132 | 133 | 134 | 139 | 140 | 147 | 148 | 155 | 156 | 157 | 158 | 163 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_info.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 24 | 25 | 31 | 40 | 48 | 56 | 64 | 72 | 80 | 81 | 82 | 86 | 87 | 93 | 94 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-fr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | SoundMeter 4 | 5 | Ceci est une boîte de message personnalisé 6 | A propos des Décibels 7 | Ok 8 | Impossible de démarrer l\'enregistrement 9 | Recorder est occupé ou l\'autorisation d\'enregistrement est interdite 10 | Impossible de créer le fichier 11 | 12 | Minimum 13 | Moyenne 14 | Maximum 15 | Temps réel 16 | 17 | 0dB : la plupart des gens entendent juste un faible bruit. 18 | 30dB~40dB c\'est le calme idéal. 19 | 50dB et plus : affecte le repos et le sommeil. 20 | 70dB et plus : peut affecter l\'apprentissage et le travail. 21 | 90dB et plus affectent audition. 22 | 150dB : une exposidtion soudaine à un environnement sonore de 150dB, va rompre les tympans. L\'audition sera complètement perdue 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values-zh/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 声音计 3 | 4 | 这个就是自定义的提示框 5 | 关于分贝 6 | 知道了 7 | 启动录音失败 8 | 录音机已被占用或录音权限被禁止 9 | 创建文件失败 10 | 11 | 最小 12 | 平均 13 | 最大 14 | 实时 15 | 16 | 0dB是人刚能听到的最微弱的声音; 17 | 30dB~40dB是较为理想的安静环境; 18 | 超过50dB会影响休息和睡眠 19 | 超过70dB会影响学习和工作; 20 | 超过90dB会影响听力; 21 | 如果突然暴露在高达150db的噪声环境中,鼓膜会破裂出血,双耳完全失去听力 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #00ce44 7 | #37aaa9 8 | #46dad8 9 | #ff6c4d70 10 | #35824e 11 | #9C27B0 12 | #18eb5e 13 | #e515171d 14 | #ffb4b4b4 15 | #6200EA 16 | #18e9eb 17 | #ffdcefff 18 | #323232 19 | #111111 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | SoundMeter 3 | 4 | This is a custom message box 5 | About Decibel 6 | Ok 7 | Unable to start recording 8 | Recorder is busy or permission to record is prohibited 9 | Can not create file 10 | 11 | Minimum 12 | Average 13 | Maximum 14 | Real Time 15 | 16 | 0dB : Most people just hear a low noise. 17 | 30dB~40dB it\'s the ideal calm. 18 | 50dB and more: affects rest and sleep. 19 | 70dB and more: can affect learning and work. 20 | 90dB and more affect audition. 21 | 150dB : A sudden exposure to a sound environment of 150dB, will break the eardrums. The audition will be completely lost. 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 17 | 18 | 23 | 24 | 30 | 31 | 37 | 38 | 42 | 43 | 48 | 49 | 55 | 58 | 59 | -------------------------------------------------------------------------------- /app/src/test/java/com/bodekjan/soundmeter/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.bodekjan.soundmeter; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | google() 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:8.8.2' 10 | 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | google() 19 | mavenCentral() 20 | maven { url "https://jitpack.io" } 21 | } 22 | } 23 | 24 | task clean(type: Delete) { 25 | delete rootProject.buildDir 26 | } 27 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/full_description.txt: -------------------------------------------------------------------------------- 1 | Sound-meter is an android application that measures sound level in decibel 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/fastlane/metadata/android/en-US/images/icon.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/sm_en.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/fastlane/metadata/android/en-US/images/phoneScreenshots/sm_en.jpg -------------------------------------------------------------------------------- /fastlane/metadata/android/fr-FR/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/fastlane/metadata/android/fr-FR/images/icon.png -------------------------------------------------------------------------------- /fastlane/metadata/android/fr-FR/images/phoneScreenshots/sm_en.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/fastlane/metadata/android/fr-FR/images/phoneScreenshots/sm_en.jpg -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | android.useAndroidX=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /local.properties: -------------------------------------------------------------------------------- 1 | ## This file must *NOT* be checked into Version Control Systems, 2 | # as it contains information specific to your local configuration. 3 | # 4 | # Location of the SDK. This is only used by Gradle. 5 | # For customization when using a Version Control System, please read the 6 | # header note. 7 | #Sat Mar 15 14:11:47 CET 2025 8 | sdk.dir=/home/nicolas/android-tools/android-sdk-linux 9 | -------------------------------------------------------------------------------- /screenshots/sm_en.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/screenshots/sm_en.jpg -------------------------------------------------------------------------------- /screenshots/sm_fr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/screenshots/sm_fr.jpg -------------------------------------------------------------------------------- /screenshots/sm_zh.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff2900/Sound-Meter/4ab21612438e3fd9108ec92fba8673cbe212f0e8/screenshots/sm_zh.jpg -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------