mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix
This commit is contained in:
+8
-16
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user