├── logo.webp ├── README-zh.md ├── README.md └── index.html /logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EtherDream/headphone-morse-transmitter/HEAD/logo.webp -------------------------------------------------------------------------------- /README-zh.md: -------------------------------------------------------------------------------- 1 | # 🎧 摩尔斯码发送器 2 | 3 | 很多耳机可以发送 ⏮️ ⏸️ ⏯️ 命令,例如 Airpods,按一下可暂停或继续,按两下可播放下一曲,按三下可播放上一曲。 4 | 5 | 利用这个特征,我们可通过按耳机发送摩尔斯码! 6 | 7 | ## 在线演示 8 | 9 | [https://etherdream.com/headphone-morse-transmitter/](https://etherdream.com/headphone-morse-transmitter/) 10 | 11 | 由于浏览器限制,你必须点击任意位置才能初始化音频(播放一个几乎静音的背景音乐),从而可接受耳机命令。 12 | 13 | 请先关闭其他播放器,否则耳机命令可能不会发送到本页面上。如果页面仍无法收到耳机命令,可点击 `Debug` 检测音频是否在播放,如果没有可手动播放。 14 | 15 | https://github.com/user-attachments/assets/37cf43c2-ec2f-429a-b2b2-47a96a5ad242 16 | 17 | > 由于声音是从耳机里发出来的,因此很轻。 18 | 19 | ## 使用方式 20 | 21 | ⏸️ = 点 (.) 22 | 23 | ⏯️ = 划 (-) 24 | 25 | ⏮️ = 输出 或 退格 26 | 27 | 按下 ⏮️ 时,如果 `Input` 存在内容,则立即输出内容;如果 `Input` 为空,则相当于退格键,删除 `Words` 最后一个字符。 28 | 29 | 距上一次按键达到 `Delay` 毫秒时,`Input` 中的内容将会被自动输出。 30 | 31 | 本程序支持 [国际码](https://en.wikipedia.org/wiki/Morse_code)、[和文码](https://en.wikipedia.org/wiki/Wabun_code)、[中文电码](https://zh.wikipedia.org/wiki/%E4%B8%AD%E6%96%87%E7%94%B5%E7%A0%81) 以及部分私有特征。 32 | 33 | ## 特殊功能 34 | 35 | * ``: 换行 (`.-.-`) 36 | 37 | * ``: 清空最后行 (`.` x8) 38 | 39 | * ``: 切换到和文码 (`-..---`) 40 | 41 | * ``: 返回到国际码 (`...-.`) 42 | 43 | * `\d{2,4}`: 输入 2~4 个数字,输出 1 个汉字。参考 [1983年标准电码本](https://zh.wiktionary.org/wiki/Appendix:%E4%B8%AD%E6%96%87%E7%94%B5%E7%A0%81/%E4%B8%AD%E5%9B%BD%E5%A4%A7%E9%99%861983)(前两个 0 可忽略)。 44 | 45 | ## 私有功能 46 | 47 | * ``: 语音朗读最后一行 (`.` x6) 48 | 49 | * ``: 切换到小写/平假名(`.-..---`) 50 | 51 | * ``: 切换到大写/片假名(`..-.--.`) 52 | 53 | * ``: 空格 (`....--.`) 54 | 55 | * `` + 假名 = 小假名 (`-..- ?`) 56 | 57 | 支持 `っ ゃゅょ ぁぃぅぇぉ ゕゖ` 以及相应的片假名。 58 | 59 | ## 键盘操作 60 | 61 | 如果你不想使用耳机,也可使用键盘上的 ⏮️ ⏸️ ⏯️ 键,这样可更快输入: 62 | 63 | https://github.com/user-attachments/assets/60bc966c-e960-4c0e-82e3-e4769613d91d 64 | 65 | 此外,点击媒体控制浮层中的 ⏮️ ⏸️ ⏯️ 按钮也可以实现同样的效果。 66 | 67 | https://github.com/user-attachments/assets/45395d2d-5624-4061-be12-bbe22c645d86 68 | 69 | 70 | ## 后台运行 71 | 72 | 本程序可在后台运行,即使浏览器最小化,甚至锁屏也能运行。 73 | 74 | 因此你可以在手机上打开该网页,锁屏后盲发摩尔斯电码。只需按耳机,听反馈,无需看屏幕。 75 | 76 | https://github.com/user-attachments/assets/4fd3d899-7153-4029-8643-4775c699265e 77 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🎧 Morse Transmitter 2 | 3 | [中文版](README-zh.md) 4 | 5 | Many headphones can send ⏮️ ⏸️ ⏯️ commands, such as Airpods, with a single press to pause or resume, double press to play the next track, and triple press to play the previous track. 6 | 7 | Using this feature, we can use headphones as morse transmitters. 8 | 9 | ## Demo 10 | 11 | [https://etherdream.github.io/headphone-morse-transmitter/](https://etherdream.github.io/headphone-morse-transmitter/) 12 | 13 | Due to browser limitations, you must click anywhere to init the audio (which plays an almost silent BGM) so that the headphone command can be received. 14 | 15 | Please close the other players first, otherwise the headphone command may not be sent to this page. If the page still can't receive the headphone command, you can click `Debug` to check if the audio is playing, if not, you can play it manually. 16 | 17 | https://github.com/user-attachments/assets/37cf43c2-ec2f-429a-b2b2-47a96a5ad242 18 | 19 | > The sound in this video comes from headphones, so it's very light. 20 | 21 | ## Usage 22 | 23 | ⏸️ = dit (.) 24 | 25 | ⏯️ = dah (-) 26 | 27 | ⏮️ = flush or backspace 28 | 29 | When ⏮️ is pressed, if `Input` buffer is not empty, it will be flush immediately; otherwise, it is equivalent to the backspace key, which is used to delete the last character of `Words`. 30 | 31 | When `Delay` time has passed since the last key press, `Input` buffer will be flush automatically. 32 | 33 | This program supports [International Morse Code](https://en.wikipedia.org/wiki/Morse_code), [Wabun Code](https://en.wikipedia.org/wiki/Wabun_code), [Chinese telegraph code](https://en.wikipedia.org/wiki/Chinese_telegraph_code) and some private features. 34 | 35 | ## Special Feature 36 | 37 | * ``: New line (`.-.-`) 38 | 39 | * ``: Delete the last line (`.` x8) 40 | 41 | * ``: Change to Wabun Code (`-..---`) 42 | 43 | * ``: Return to International Code (`...-.`) 44 | 45 | * `\d{2,4}`: Input 2~4 digits and output 1 Chinese character. 46 | 47 | Refer to the [Chinese telegraph code/Mainland 1983](https://en.wiktionary.org/wiki/Appendix:Chinese_telegraph_code/Mainland_1983). 48 | 49 | 50 | ## Private Feature 51 | 52 | * ``: Say the last line (`.` x6) 53 | 54 | * ``: Change to lowercase/hiragana (`.-..---`) 55 | 56 | * ``: Change to uppercase/katakana (`..-.--.`) 57 | 58 | * ``: Add a space (`....--.`) 59 | 60 | * `` + kana = small kana (`-..- ?`) 61 | 62 | Supports `っ ゃゅょ ぁぃぅぇぉ ゕゖ` and the corresponding katakana. 63 | 64 | ## Keyboard 65 | 66 | If you don't want to use a headphone, you can also use ⏮️ ⏸️ ⏯️ keys on your keyboard, which is actually faster: 67 | 68 | https://github.com/user-attachments/assets/60bc966c-e960-4c0e-82e3-e4769613d91d 69 | 70 | Alternatively, you can click ⏮️ ⏸️ ⏯️ buttons in the media control popup. 71 | 72 | https://github.com/user-attachments/assets/45395d2d-5624-4061-be12-bbe22c645d86 73 | 74 | 75 | ## Blind Mode 76 | 77 | This program can run in the background, even if the browser is minimized or the screen is locked. So you can use this program on your phone to practice Morse code, using only your fingers and ears, without eyes! 78 | 79 | https://github.com/user-attachments/assets/4fd3d899-7153-4029-8643-4775c699265e 80 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Morse Transmitter 7 | 8 | 42 | 43 | 44 |

🎧 Morse Transmitter

45 |
46 | 47 | Pause/Play: · (dit) 48 |
49 |
50 | 51 | Next track: ─ (dah) 52 |
53 |
54 | 55 | Prev track: ← (flush or backspace) 56 |
57 |
58 | 59 | Delay: ms 60 |
61 |
62 | 63 | Voice: 64 |
    65 |
  • 66 |
  • 67 |
  • 68 |
69 |
70 |
71 | 72 | Input: initing... 73 |
74 |
75 | 76 | Words: 77 |
78 |
79 | 80 |
81 |
82 |
83 |

84 | 85 | International Morse Code 86 | / 87 | 和文モールス符号 88 | / 89 | 中文电码 90 |

91 |

92 | 93 | .... 94 | . 95 | .-.. 96 | .-.. 97 | --- 98 | .-.- 99 | .-- 100 | --- 101 | .-. 102 | .-.. 103 | -.. 104 | -.-.-- 105 |

106 |

107 | 108 | -..--- 109 | .-..--- 110 | .-- 111 | --.-- 112 | .-.-.- 113 | ..-.--. 114 | -..-. 115 | .--.- 116 | -.--. 117 | ---.- 118 | .-.-.. 119 |

120 |

121 | 122 | ..--- ..--- 123 | ----. ....- ---.. 124 | ---.. -.... 125 |

126 |
127 |
128 | 129 | Debug 130 | 135 |
136 | 663 | 664 | --------------------------------------------------------------------------------