diff --git a/vocodes/src/v2/tts_result_view/SpectrogramFc.tsx b/vocodes/src/v2/tts_result_view/SpectrogramFc.tsx index eb8dfa60c2..804a4b30d4 100644 --- a/vocodes/src/v2/tts_result_view/SpectrogramFc.tsx +++ b/vocodes/src/v2/tts_result_view/SpectrogramFc.tsx @@ -16,10 +16,6 @@ interface SpectrogramResponse { const COLOR_MAP_PRESETS = [ VIRIDIS, MAGMA, - //CIVIDIS, - //BLACK_WHITE, - //INFERNO, - //PLASMA, ]; function SpectrogramFc(props: Props) { @@ -33,12 +29,12 @@ function SpectrogramFc(props: Props) { let bytes = new Uint8ClampedArray(size); - let k = 0; - let colorMapScale = linearScale([0, 255], [0, 1]); let colorMapColors = getRandomArrayValue(COLOR_MAP_PRESETS); let colorMap = createColorMap(colorMapColors, colorMapScale); + let k = 0; + for (let j = 0; j < height; j++) { for (let i = 0; i < width; i++) { let value = image[i][j]; @@ -58,9 +54,6 @@ function SpectrogramFc(props: Props) { } useEffect(() => { - //const api = new ApiConfig(); - //const endpointUrl = api.viewTtsInferenceResult(token); - fetch(props.spectrogramJsonLink, { method: 'GET', headers: { @@ -95,7 +88,6 @@ function SpectrogramFc(props: Props) { let width = 150 * 3; let height = 80 * 3; - //onClick={() => this.props.changeSpectrogramMode(nextMode)} let canvas = {canvas} -

(Click or tap to change spectrogram theme.)

) } diff --git a/vocodes/src/v2/tts_result_view/TtsResultViewFc.tsx b/vocodes/src/v2/tts_result_view/TtsResultViewFc.tsx index 2f580073d2..25c9e93bbd 100644 --- a/vocodes/src/v2/tts_result_view/TtsResultViewFc.tsx +++ b/vocodes/src/v2/tts_result_view/TtsResultViewFc.tsx @@ -78,6 +78,9 @@ function TtsResultViewFc(props: Props) { let audioLink = `https://storage.googleapis.com/dev-vocodes-public${ttsInferenceResult?.public_bucket_wav_audio_path}`; let modelLink = `/tts/${ttsInferenceResult.tts_model_token}`; + // NB: Not respected in firefox: https://stackoverflow.com/a/28468261 + let audioDownloadFilename = `vocodes-${ttsInferenceResult.tts_model_token.replace(':', '')}.wav`; + let spectrogramLink = `https://storage.googleapis.com/dev-vocodes-public${ttsInferenceResult?.public_bucket_wav_audio_path}`.replace(".wav", ".json"); @@ -129,8 +132,6 @@ function TtsResultViewFc(props: Props) {

{headingTitle}

{subtitle} - - + Download File + +
+
+ + +

Spectrogram

+ + +
+
+ +

Details