mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-11 12:23:20 +00:00
flip spectrogram
This commit is contained in:
1 parent
fee33c4179
commit
f300f3e61b
2 files changed
+7
-3
No files matched your search
@@ -20,4 +20,8 @@
|
||||
|
||||
.track_text {
|
||||
margin-left: 0.5em;
|
||||
}
|
||||
|
||||
canvas#spectrogram {
|
||||
transform: scaleY(-1); /* Spectrograms are flipped */
|
||||
}
|
||||
+3
-3
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user