https://github.com/kimjuls/voicedetector
https://github.com/kimjuls/voicedetector
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kimjuls/voicedetector
- Owner: kimjuls
- License: mit
- Created: 2021-12-29T03:33:58.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-12-29T08:17:27.000Z (over 3 years ago)
- Last Synced: 2025-02-11T18:44:59.038Z (4 months ago)
- Language: Java
- Size: 71.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Voice Detector (For Android Java)
Voice Detector is a handy module that detects audio input from android and returns it as a decibel value.
## How to use
### Step. 1
This module need RECORD_AUDIO. Add the following inside the tag in Manifest.xml
```xml```
RECORD_AUDIO is considered a 'dangerous' permission because it may pose a risk to the user's privacy. Starting with Android 6.0 (API level 23), apps using dangerous permissions must ask the user for permission at runtime. See the Android developer documentation below to learn how to request runtime permissions (dangerous permissions).https://developer.android.com/guide/topics/permissions/overview#runtime
### Step. 2
Add it in your root build.gradle (Project) at the end of repositories:
```gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
### Step. 3
Add the dependency in build.gradle(Module) and click "sync now".```gradle
dependencies {
implementation 'com.github.mangneung:VoiceDetector:0.0.4'
}
```### Step. 4
in your android component
```java
VoiceDetector mDetector = new VoiceDetector(this);
mDetector.startReader(new VoiceDetector.Listener() {
@Override
public void onReadComplete(int decibel) {
Log.e("Detected: ", decibel + "dB");
}@Override
public void onReadError(int error) {}
});
```
### Step. 5
Now you just have to define operations you want in the overrided methods.## License
MIT License