From 813a1bb59d1b605cf5420148711aa6d72aeea952 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 6 Jun 2018 17:06:40 +0200 Subject: ok happy with this --- app/client/common/fileUpload.component.js | 1 + app/client/modules/pix2wav/views/spectrogram.upload.js | 18 +++++------------- 2 files changed, 6 insertions(+), 13 deletions(-) (limited to 'app') diff --git a/app/client/common/fileUpload.component.js b/app/client/common/fileUpload.component.js index e723a0c..bc78184 100644 --- a/app/client/common/fileUpload.component.js +++ b/app/client/common/fileUpload.component.js @@ -27,6 +27,7 @@ class FileUpload extends Component { {this.props.title} diff --git a/app/client/modules/pix2wav/views/spectrogram.upload.js b/app/client/modules/pix2wav/views/spectrogram.upload.js index 7b5e618..efbfca7 100644 --- a/app/client/modules/pix2wav/views/spectrogram.upload.js +++ b/app/client/modules/pix2wav/views/spectrogram.upload.js @@ -29,7 +29,7 @@ class SpectrogramUpload extends Component { datasetName: "", frames: [], frame_start: 0, - max: 3000, + max: 1000, frame_step: wav2pixActions.FRAME_STEP, } const audioElement = document.createElement('audio') @@ -38,7 +38,7 @@ class SpectrogramUpload extends Component { const total_frame_count = Math.floor((duration * 44100 - wav2pixActions.FRAME_LENGTH) / this.state.frame_step) this.setState({ duration, - max: Math.min(this.state.max, total_frame_count), + max: Math.min(this.state.max, total_frame_count, 1000), }) }) this.audioElement = audioElement @@ -54,12 +54,9 @@ class SpectrogramUpload extends Component { datasetName: name, pcm: '' }, () => { - if (file.size < 2 << 20) { - this.rebuildFrames() - } + this.rebuildFrames() }) this.audioElement.src = URL.createObjectURL(file) - console.log(file.size) } rebuildFrames(){ const { file, pcm, frame_step, frame_start } = this.state @@ -101,11 +98,10 @@ class SpectrogramUpload extends Component {

{"Convert your sounds into spectrograms. "} {"Sound files can be WAV, MP3, AIFF, or FLAC. "} - 2 minutes max.

this.pickFile(file)} /> {file && this.renderMetadata(file)} @@ -123,10 +119,6 @@ class SpectrogramUpload extends Component { const frame_step = Math.round(this.state.frame_step / 44100 * 1000) + ' ms.' return (
- {file.size > 2 << 20 && -

- Careful, your file is larger than 2 MB. -

} {file.name} {file.type} @@ -186,7 +178,7 @@ class SpectrogramUpload extends Component { /> + >Upload Frames
-- cgit v1.2.3-70-g09d2