summaryrefslogtreecommitdiff
path: root/src/pages/chart/ChartPage.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/chart/ChartPage.tsx')
-rw-r--r--src/pages/chart/ChartPage.tsx16
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(() => {