Only stop recording if we have collected some samples.
On slow machines it was possible to double click record before the chunk of samples had been processed, causing zero-length audio buffers
This commit is contained in:
1 parent
f3c15c402f
commit
3f51775f07
1 file changed
+3
-1
@@ -43,7 +43,9 @@ class RecordModal extends React.Component {
|
||||
this.setState({recording: true});
|
||||
}
|
||||
handleStopRecording (samples, sampleRate, levels, trimStart, trimEnd) {
|
||||
this.setState({samples, sampleRate, levels, trimStart, trimEnd, recording: false});
|
||||
if (samples.length > 0) {
|
||||
this.setState({samples, sampleRate, levels, trimStart, trimEnd, recording: false});
|
||||
}
|
||||
}
|
||||
handlePlay () {
|
||||
this.setState({playing: true});
|
||||
|
||||
Reference in new issue
Block a user