diff --git a/commands/voice/morse.js b/commands/voice/morse.js index 6826cb32..c2c8859c 100644 --- a/commands/voice/morse.js +++ b/commands/voice/morse.js @@ -65,25 +65,17 @@ module.exports = class MorseCommand extends Command { } const c = processedScript[cIndex]; if (c === '.') { - for (let i = 0; i < dotSamples * 2; i++) { - if (i > dotSamples) { - data[(currentIndex * dotSamples) + i] = 127; - } else { - const libIndex = this.library[44 + i]; - data[(currentIndex * dotSamples) + i] = libIndex; - } + for (let i = 0; i < dotSamples; i++) { + const libIndex = this.library[44 + i]; + data[(currentIndex * dotSamples) + i] = libIndex; } - currentIndex += 2; + currentIndex += 1; } else if (c === '-') { - for (let i = 0; i < dashSamples + dotSamples; i++) { - if (i > dashSamples) { - data[(currentIndex * dashSamples) + i] = 127; - } else { - const libIndex = this.library[44 + dotSamples + i]; - data[(currentIndex * dashSamples) + i] = libIndex; - } + for (let i = 0; i < dashSamples; i++) { + const libIndex = this.library[44 + dotSamples + i]; + data[(currentIndex * dashSamples) + i] = libIndex; } - currentIndex += 4; + currentIndex += 3; } else if (c === ' ' && processedScript[cIndex + 1] === ' ') { for (let i = 0; i < dotSamples * 7; i++) { data[(currentIndex * dotSamples) + i] = 127;