-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b5a300
commit 05b3646
Showing
4 changed files
with
70 additions
and
10 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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,69 @@ | ||
# RecordWav | ||
# RecordWav | ||
|
||
集 【录制】、【播放】、【解析】于一体的wav文件的工具类。 | ||
|
||
功能包括: | ||
|
||
- 录制wav文件。(录音、暂停、完成) | ||
- 播放wav文件。(自定义播放、系统播放) | ||
- 解析已有wav文件的信息。 | ||
|
||
![show_recorder](https://github.com/shaoshuai904/RecordWav/blob/master/screens/show_recorder.png) | ||
|
||
|
||
集 【录制】、【播放】、【解析】于一体的wav文件的工具类。 | ||
### 快速使用 | ||
|
||
功能包括: | ||
**Step 1.** Add it in your root build.gradle at the end of repositories: | ||
|
||
- 录制wav文件。(录音、暂停、完成) | ||
```groovy | ||
allprojects { | ||
repositories { | ||
... | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} | ||
``` | ||
|
||
- 播放wav文件。(自定义播放、系统播放) | ||
**Step 2.** Add the dependency | ||
|
||
- 解析已有wav文件的信息。 | ||
```groovy | ||
dependencies { | ||
compile 'com.github.shaoshuai904:RecordWav:1.0' | ||
} | ||
``` | ||
|
||
|
||
### MsRecorder | ||
|
||
构造参数:[ 文件保存路径 + 参数配置 + 各类监听回调 ] | ||
方法:startRecording pauseRecording resumeRecording stopRecording | ||
|
||
``` | ||
Recorder recorder; | ||
recorder = MsRecorder.wav( | ||
new File(voicePath), | ||
new AudioRecordConfig.Default(), | ||
new PullTransport.Default( | ||
new PullTransport.OnAudioChunkPulledListener() { | ||
@Override | ||
public void onAudioChunkPulled(AudioChunk audioChunk) { | ||
Log.d("max ", "amplitude: " + audioChunk.maxAmplitude()); | ||
} | ||
} | ||
) | ||
); | ||
TODO: | ||
wav文件格式转换 | ||
recorder.startRecording(); | ||
recorder.pauseRecording(); | ||
recorder.resumeRecording(); | ||
recorder.stopRecording(); | ||
``` | ||
|
||
|
||
开发平台:android studio | ||
|
||
开发平台:android studio。 | ||
运行平台:android 手机 | ||
|
||
|
||
|
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