an ideal WAV PCM recorder library for Android
Record WAV or PCM voice library on Android, support volume, recording data, recording status, file path callback
- Customizable recording parameters (sampling rate, number of bits, single and dual channel)
- Easy to use, call start to start recording, call stop to stop recording.
- Support for setting the maximum recording voice duration. It will automatically stop when maximum duration comes.
- Support saving WAV files when you set the save path.
- You can set the volume callback interval duration, support return buffer data when recording.
- Callback when no record permission
Add code in the Application or Activity onCreate () method,pass context
IdealRecorder.getInstance().init(this);
Start recording
idealRecorder = IdealRecorder.getInstance();
idealRecorder.setRecordFilePath(getSaveFilePath());
//If you need to save the recording file, set the path and save it automatically.
//you can save it on you own by getting data in onRecordData callback
idealRecorder.setRecordConfig(recordConfig).setMaxRecordTime(20000).setVolumeInterval(200);
idealRecorder.setStatusListener(statusListener);
//set listener
idealRecorder.start();
//start record
setRecordFilePath path should be absolutePath
recordConfig look IdealRecorder.RecordConfig class
Please refer to the demo code .
Stop recording
idealRecorder.stop();
- The project manifest has declared the RECORD_AUDIO and WRITE_EXTERNAL_STORAGE permission .However, after Android 6.0, you still need to request permission on you own.
- Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Add the dependency
dependencies {
implementation'com.github.ideastudios:IdealRecorder:2.0.4'
}
WaveLineViewJay-Goo/WaveLineView AndPermissionyanzhenjie/AndPermission