Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- generateMorse(time: any, phrase: string) {
- phrase = phrase.toUpperCase();
- this.morseDisplay = [];
- for (const p of phrase) {
- if (p === ' ') {
- time += 3 * this.dot;
- } else if (this.MORSE[p] !== undefined) {
- time = this.createSound(time, this.MORSE[p]);
- time += 2 * this.dot;
- }
- const morseOuput = new MorseOutput();
- morseOuput.morseText = p;
- morseOuput.morseValue = this.MORSE[p];
- this.morseDisplay.push(morseOuput);
- }
- return time;
- }
Add Comment
Please, Sign In to add comment