diff options
| author | Yuval Adam <_@yuv.al> | 2025-03-10 11:26:42 +0100 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2025-03-10 11:26:42 +0100 |
| commit | c1c24f429fc8dd8c27871c8d9c45c1a934f8b88b (patch) | |
| tree | 4b3f82eac54b129c71c3aae621ba45ccfc93a77c /src/pages/chart/ChartPage.tsx | |
| parent | a39c5768bb1f140ad265cfe8f3a2aab0466ad256 (diff) | |
Diffstat (limited to 'src/pages/chart/ChartPage.tsx')
| -rw-r--r-- | src/pages/chart/ChartPage.tsx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/pages/chart/ChartPage.tsx b/src/pages/chart/ChartPage.tsx index 784aa0d..ffb679e 100644 --- a/src/pages/chart/ChartPage.tsx +++ b/src/pages/chart/ChartPage.tsx @@ -43,10 +43,18 @@ const ChartPage = () => { clickedItem.classList.add('playing'); } - cw.play(character, { - wpm: 20, - actx: actxRef.current - }); + try { + // Get Morse code for the character + const morseCode = getMorseCode(character); + + // Play the Morse code + window.cw.play(morseCode, { + wpm: 20, + actx: actxRef.current + }); + } catch (error) { + console.error('Error playing Morse code:', error); + } // Remove the 'playing' class after the audio finishes setTimeout(() => { |
