Skip to content

Commit

Permalink
add callback on worker thread
Browse files Browse the repository at this point in the history
  • Loading branch information
ideastudios committed Feb 26, 2019
1 parent 26373f1 commit 46ed563
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 47 deletions.
22 changes: 0 additions & 22 deletions .idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

31 changes: 10 additions & 21 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ statusListener为回调是的listener 重写需要用到的回调即可
}
}
```

2. Add the dependency
```
dependencies {
compile 'com.github.ideastudios:IdealRecorder:1.0.3'
implementation 'com.github.ideastudios:AndroidPcmResample:v1.1.1'
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ public void onRecorded(final short[] wave) {
audioFileHelper.save(bytes, 0, bytes.length);
}
byteArrayOutputStream.write(bytes, 0, bytes.length);
if (statusListener != null) {
statusListener.onRecordDataOnWorkerThread(wave, wave == null ? 0 : wave.length);
}
runOnUi(new Runnable() {
@Override
public void run() {
Expand Down
10 changes: 10 additions & 0 deletions library/src/main/java/tech/oom/idealrecorder/StatusListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ public void onStartRecording() {
public void onRecordData(short[] data, int length) {
}

/**
* 录音时的buffer回调 在工作线程中
*
* @param data PCM Data
* @param length 长度
*/
public void onRecordDataOnWorkerThread(short[] data, int length) {

}


/**
* 录音时的音量
Expand Down

0 comments on commit 46ed563

Please sign in to comment.