summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-06-06 17:06:40 +0200
committerJules Laplace <julescarbon@gmail.com>2018-06-06 17:06:40 +0200
commit813a1bb59d1b605cf5420148711aa6d72aeea952 (patch)
tree34b8c3cb9ce6922fcb54ee66dac77ffa2e1a0783 /app
parent341b76441b0c9a3167d81c8d4fd8e7a260763604 (diff)
ok happy with this
Diffstat (limited to 'app')
-rw-r--r--app/client/common/fileUpload.component.js1
-rw-r--r--app/client/modules/pix2wav/views/spectrogram.upload.js18
2 files changed, 6 insertions, 13 deletions
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 {
<span>{this.props.title}</span>
<input
type='file'
+ accept={this.props.accept || '*/*'}
multiple={this.props.multiple}
onChange={this.handleChange}
/>
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 {
<p>
{"Convert your sounds into spectrograms. "}
{"Sound files can be WAV, MP3, AIFF, or FLAC. "}
- <b>2 minutes max.</b>
</p>
<FileUpload
title='Choose a sound file'
- mime='image.*'
+ accept='audio/*'
onUpload={file => 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 (
<div className='fileMetadata'>
- {file.size > 2 << 20 &&
- <p>
- <i>Careful, your file is larger than 2 MB.</i>
- </p>}
<Group title='Metadata'>
<Param title='Name'>{file.name}</Param>
<Param title='Type'>{file.type}</Param>
@@ -186,7 +178,7 @@ class SpectrogramUpload extends Component {
/>
<Button
onClick={() => this.buildZip()}
- >Build Zip</Button>
+ >Upload Frames</Button>
</Group>
<Progress />
</div>