Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
dofuuz committed Mar 5, 2022
1 parent 12cbbfc commit ccd5f37
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/plugin/spectrogram/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default class SpectrogramPlugin {
this.splitChannels = params.splitChannels;
this.channels = this.splitChannels ? ws.backend.buffer.numberOfChannels : 1;

// Getting file's original samplerate is difficult(#1248).
// Getting file's original samplerate is difficult(#1248).
// So set 12kHz default to render like 5.x.
this.frequencyMin = params.frequencyMin || 0;
this.frequencyMax = params.frequencyMax || 12000;
Expand Down Expand Up @@ -279,7 +279,7 @@ export default class SpectrogramPlugin {

for (let c = 0; c < frequenciesData.length; c++) { // for each channel
const pixels = my.resample(frequenciesData[c]);
var imageData = new ImageData(new Uint8ClampedArray(width * height * 4), width, height);
const imageData = new ImageData(width, height);

for (let i = 0; i < pixels.length; i++) {
for (let j = 0; j < pixels[i].length; j++) {
Expand All @@ -293,14 +293,14 @@ export default class SpectrogramPlugin {
}

// scale and stack spectrograms
createImageBitmap(imageData).then(renderer =>
createImageBitmap(imageData).then(renderer =>
spectrCc.drawImage(renderer,
0, height * (1 - freqMax / freqFrom), // source x, y
0, height * (1 - freqMax / freqFrom), // source x, y
width, height * (freqMax - freqMin) / freqFrom, // source width, height
0, height * c, // destination x, y
width, height // destination width, height
0, height * c, // destination x, y
width, height // destination width, height
)
)
);
}
}

Expand Down

0 comments on commit ccd5f37

Please sign in to comment.