From fc1c3835501b97e5d15ac33bd812cd87b20aabad Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 6 Jun 2018 15:36:03 +0200 Subject: compute number of frames that will be generated --- app/client/modules/pix2wav/views/spectrogram.upload.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'app/client/modules/pix2wav/views') diff --git a/app/client/modules/pix2wav/views/spectrogram.upload.js b/app/client/modules/pix2wav/views/spectrogram.upload.js index 7d2be1f..40e6159 100644 --- a/app/client/modules/pix2wav/views/spectrogram.upload.js +++ b/app/client/modules/pix2wav/views/spectrogram.upload.js @@ -96,6 +96,9 @@ class SpectrogramUpload extends Component { renderMetadata(file){ const { duration } = this.state const size = util.hush_size(file.size) + const total_frame_count = (duration * 44100 - wav2pixActions.FRAME_LENGTH) / this.state.frame_step + const frame_size = Math.round(wav2pixActions.FRAME_LENGTH / 44100 * 1000) + ' ms.' + const frame_step = Math.round(this.state.frame_step / 44100 * 1000) + ' ms.' return (
{file.size > 2 << 20 && @@ -108,6 +111,9 @@ class SpectrogramUpload extends Component { {size[1]} {moment(file.lastModifiedDate).format("YYYY-MM-DD h:mm a")} {Math.floor(duration) + ' s.'} + {Math.floor(total_frame_count)} + {frame_size} + {frame_step}
{this.props.pix2wav.status}
@@ -119,8 +125,8 @@ class SpectrogramUpload extends Component { value={this.state.name} /> this.setState({ max })} /> -- cgit v1.2.3-70-g09d2