linux-do-voice-msg

为 linux.do 编辑器提供语音录制、上传与播放能力。

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

יוצר
helloai
התקנות יומיות
0
סה"כ התקנות
17
דירוגים
0 0 0
גרסה
1.0.6
נוצר
06-03-2026
עודכן
23-03-2026
Size
209 קילו-בייט
רישיון
MIT
חל על

Linux.do 语音消息

一个面向 https://linux.do/* 的油猴脚本项目,为 Discourse 编辑器提供内联语音录制、上传,以及帖子内语音消息播放器替换能力。

项目基于 Svelte 5 + TypeScript + Vite + vite-plugin-monkey 构建。

  • 在 Discourse 编辑器工具栏中注入录音按钮。
  • 同时兼容 Discourse Markdown 编辑器与富文本编辑器。
  • 点击录音按钮后,直接在当前编辑区内展开内联录音条,不使用弹窗。
  • 录音条支持:开始录音、暂停/继续、删除、发送、上传进度提示。
  • 仅在实际录音阶段占用麦克风;暂停、待发送、上传中会立即释放麦克风。
  • 发送成功后会自动换到下一行,便于继续补充文字。
  • 录音固定码率 64 kbps,最长 5 分钟,并在上传前做最终大小校验。
  • 上传时自动走 Discourse 同源上传接口 /uploads.json,自动处理 CSRF Token。
  • 上传成功后自动向编辑器插入标准 Markdown:
  • 页面中出现上述标准语音文案时,自动替换成胶囊式语音播放器。
  • 播放器支持播放、暂停、重播、波形进度、高亮已播放区、当前/总时长显示。
  • 播放器在同一张播放卡片内提供“转文字 / 重试转文字”文字按钮;当转写内容超过一行时,才显示展开/折叠图标按钮。
  • 已完成的转写结果会按语音附件 URL 缓存在内存里;帖子滚动触发 DOM 重建后,可自动恢复已转出的文字。
  • 播放前会先抓取音频字节并预解码时长,避免首次播放时总时长很晚才出现。
  • 组件颜色尽量基于 Discourse 原生 CSS 变量,适应论坛主题。