-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
增加设置录音是否为wav格式的功能 默认为true 增加英文readme
- Loading branch information
1 parent
8831fdf
commit e68caef
Showing
10 changed files
with
176 additions
and
44 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# IdealRecorder | ||
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 | ||
|
||
## [README of Chinese][README] | ||
|
||
## GIF | ||
<img src="gif/screenrecorder.gif"/> | ||
|
||
## feature | ||
|
||
- 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 | ||
|
||
|
||
|
||
## Initialization | ||
|
||
Add code in the Application or Activity onCreate () method,pass context | ||
|
||
```java | ||
IdealRecorder.getInstance().init(this); | ||
``` | ||
|
||
|
||
|
||
## How to use | ||
|
||
Start recording | ||
```java | ||
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 | ||
```java | ||
|
||
idealRecorder.stop(); | ||
|
||
``` | ||
|
||
|
||
|
||
|
||
|
||
## Note | ||
|
||
- 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. | ||
|
||
|
||
## Gradle | ||
[](https://www.jitpack.io/#ideastudios/IdealRecorder) | ||
1. Add it in your root build.gradle at the end of repositories: | ||
``` | ||
allprojects { | ||
repositories { | ||
... | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} | ||
``` | ||
|
||
2. Add the dependency | ||
``` | ||
dependencies { | ||
implementation'com.github.ideastudios:IdealRecorder:2.0.1' | ||
} | ||
``` | ||
|
||
|
||
## Thanks | ||
|
||
WaveLineView[Jay-Goo/WaveLineView](https://github.com/Jay-Goo/WaveLineView) | ||
AndPermission[yanzhenjie/AndPermission](https://github.com/yanzhenjie/AndPermission) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters