diff --git a/src/containers/sound-editor.jsx b/src/containers/sound-editor.jsx index abe292724939fb82e75b4ebed66bd56982e48306..7316a8de7ba4f19b8cb5bf7e21466a06a48d4020 100644 --- a/src/containers/sound-editor.jsx +++ b/src/containers/sound-editor.jsx @@ -120,8 +120,10 @@ class SoundEditor extends React.Component { const sampleCount = samples.length; const startIndex = Math.floor(this.state.trimStart * sampleCount); const endIndex = Math.floor(this.state.trimEnd * sampleCount); - const clippedSamples = samples.slice(startIndex, endIndex); - this.submitNewSamples(clippedSamples, sampleRate); + if (endIndex > startIndex) { // Strictly greater to prevent 0 sample sounds + const clippedSamples = samples.slice(startIndex, endIndex); + this.submitNewSamples(clippedSamples, sampleRate); + } } } handleUpdateTrimEnd (trimEnd) {