flip spectrogram

This commit is contained in:
Brandon Thomas committed 2020-06-17 03:16:55 -04:00
1 parent fee33c4179
commit f300f3e61b
2 files changed
+7 -3

No files matched your search

+4
View File
@@ -20,4 +20,8 @@
.track_text {
margin-left: 0.5em;
}
canvas#spectrogram {
transform: scaleY(-1); /* Spectrograms are flipped */
}
@@ -128,9 +128,9 @@ class SpeakerSpectrogramAudioForm extends React.Component<Props, State> {
var image = new ImageData(this.state.spectrogram!.pixels, width, height);
createImageBitmap(image).then(renderer =>
createImageBitmap(image).then(renderer => {
ctx.drawImage(renderer, 0, 0, width * 3, height * 3)
);
});
}
}
@@ -143,7 +143,7 @@ class SpeakerSpectrogramAudioForm extends React.Component<Props, State> {
height = this.state.spectrogram.height * 3;
}
let canvas = <canvas ref="canvas" width={width} height={height}/>
let canvas = <canvas ref="canvas" width={width} height={height} id="spectrogram" />
return (
<div>