Android Wave Recorder
A powerful and efficient library to record WAVE form audio files (WAV) in Android.
Android Wave Recorder is a lightweight library written in Kotlin to record audio files with WAVE (WAV due to its filename extension) format in Android. It's very memory efficient and easy to use library with recording customizations.
Download
Step 1. Add this in your root (Project) build.gradle at the end of repositories:
Step 2. Add the dependency
Permission
Add these permissions into your AndroidManifest.xml
and request for them in Android 6.0+
Usage
Pass in the path of the output file to WaveRecorder
class and call startRecording()
like this:
To stop recording call stopRecording()
function:
To listen to audio amplitude during recording you need to register a listener to onAmplitudeListener
:
Configuration
The default configuration for recording audio is like so:
Property | Value |
---|---|
sampleRate | 16000 |
channels | AudioFormat.CHANNEL_IN_MONO |
audioEncoding | AudioFormat.ENCODING_PCM_16BIT |
But you could change it using waveConfig
property in WaveRecorder
class based on your usage. This is an example:
Note: Wrong configuration may impacts output quality