Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
xiqi committed Apr 9, 2020
1 parent 9137de1 commit 3216a2f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ LiveAudioStream.init(options);
LiveAudioStream.on('data', data => {
// base64-encoded audio data chunks
});
...
...
LiveAudioStream.start();
...
...
LiveAudioStream.stop();
...
...
```

`audioSource` should be one of the constant values from [here](https://developer.android.com/reference/android/media/MediaRecorder.AudioSource). Default value is 6 (`VOICE_RECOGNITION`).
`audioSource` should be one of the constant values from [here](https://developer.android.com/reference/android/media/MediaRecorder.AudioSource). Default value is `6` (`VOICE_RECOGNITION`).

Use 3rd-party modules like [buffer](https://www.npmjs.com/package/buffer) to decode base64 data. Example:
```javascript
// yarn add buffer
import { Buffer } from 'buffer';
...
...
LiveAudioStream.on('data', data => {
var chunk = Buffer.from(data, 'base64');
});
Expand Down

0 comments on commit 3216a2f

Please sign in to comment.