Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.

Commit

Permalink
Update AudioExample.js
Browse files Browse the repository at this point in the history
I add `audioFileSize` and change `_finishedRecording` arguments. I wait to someone add this feature to Android version as well.
  • Loading branch information
liamse committed May 21, 2018
1 parent e5d55ef commit d136b31
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions AudioExample/AudioExample.js
Expand Up @@ -50,7 +50,7 @@ class AudioExample extends Component {
AudioRecorder.onFinished = (data) => {
// Android callback comes in the form of a promise instead.
if (Platform.OS === 'ios') {
this._finishRecording(data.status === "OK", data.audioFileURL);
this._finishRecording(data.status === "OK", data.audioFileURL, data.audioFileSize);
}
};
});
Expand Down Expand Up @@ -195,9 +195,9 @@ class AudioExample extends Component {
}
}

_finishRecording(didSucceed, filePath) {
_finishRecording(didSucceed, filePath, fileSize) {
this.setState({ finished: didSucceed });
console.log(`Finished recording of duration ${this.state.currentTime} seconds at path: ${filePath}`);
console.log(`Finished recording of duration ${this.state.currentTime} seconds at path: ${filePath} and size of ${fileSize || 0} bytes`);
}

render() {
Expand Down

0 comments on commit d136b31

Please sign in to comment.