From 082eb8579b2f732c98cca88c956011799b0e37ca Mon Sep 17 00:00:00 2001 From: himeditator Date: Mon, 7 Jul 2025 22:20:04 +0800 Subject: [PATCH] =?UTF-8?q?docs(README):=20=E6=9B=B4=E6=96=B0=E8=87=AA?= =?UTF-8?q?=E5=B8=A6=E5=AD=97=E5=B9=95=E5=BC=95=E6=93=8E=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=20(#4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 README.md、README_en.md 和 README_ja.md 中添加了自带字幕引擎的详细说明 - 给予字幕窗口更大的顶置优先级 --- README.md | 39 +++++++++++++++++++++++++++++++++- README_en.md | 40 ++++++++++++++++++++++++++++++++++- README_ja.md | 43 +++++++++++++++++++++++++++++++++++++- docs/TODO.md | 3 +++ engine-test/resample.ipynb | 3 +-- src/main/CaptionWindow.ts | 6 ++++-- 6 files changed, 127 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 375f1d8..6e9eb49 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ [项目 API 文档](./docs/api-docs/electron-ipc.md) -### 基本使用 +## 📖 基本使用 目前仅提供了 Windows 平台的可安装版本。如果要使用默认的 Gummy 字幕引擎,首先需要获取阿里云百炼平台的 API KEY 并配置到环境变量中,这样才能正常使用该模型。 @@ -50,6 +50,43 @@ - Linux 平台目前仅支持生成麦克风输入的字幕 - 目前还没有适配 macOS 平台 +## ⚙️ 自带字幕引擎说明 + +目前软件自带 1 个字幕引擎,正在规划 2 个新的引擎。它们的详细信息如下。 + +### Gummy 字幕引擎(云端) + +基于通义实验室[Gummy语音翻译大模型](https://help.aliyun.com/zh/model-studio/gummy-speech-recognition-translation/)进行开发,基于[阿里云百炼](https://bailian.console.aliyun.com)的 API 进行调用该云端模型。 + +**模型详细参数:** + +- 音频采样率支持:16kHz及以上 +- 音频采样位数:16bit +- 音频通道数支持:单通道 +- 可识别语言:中文、英文、日语、韩语、德语、法语、俄语、意大利语、西班牙语 +- 支持的翻译: + - 中文 → 英文、日语、韩语 + - 英文 → 中文、日语、韩语 + - 日语、韩语、德语、法语、俄语、意大利语、西班牙语 → 中文或英文 + +**网络流量消耗:** + +字幕引擎使用原生采样率(假设为 48kHz)进行采样,样本位深为 16bit,上传音频为为单通道,因此上传速率约为: + +$$ +48000\, \text{samples/second} \times 2\,\text{bytes/sample} \times 1\, \text{channel} = 93.75\,\text{KB/s} +$$ + +模型结果回传流量消耗较小,可以不纳入考虑。 + +### Vosk 字幕引擎(本地) + +预计基于 [vosk-api](https://github.com/alphacep/vosk-api) 进行开发,正在实验中。 + +### FunASR 字幕引擎(本地) + +如果可行,将基于 [FunASR](https://github.com/modelscope/FunASR) 进行开发。还未进行调研和可行性验证。 + ## 🚀 项目运行 ![](./assets/media/structure_zh.png) diff --git a/README_en.md b/README_en.md index 307f652..e6edb4b 100644 --- a/README_en.md +++ b/README_en.md @@ -24,7 +24,7 @@ [Project API Documentation (Chinese)](./docs/api-docs/electron-ipc.md) -### Basic Usage +## 📖 Basic Usage Currently, only an installable version for the Windows platform is provided. If you want to use the default Gummy caption engine, you first need to obtain an API KEY from the Alibaba Cloud Model Studio and configure it in the environment variables. This is necessary to use the model properly. @@ -49,6 +49,44 @@ Notes: - The Linux platform currently only supports generating captions for microphone input. - The macOS platform is not yet supported. +## ⚙️ Subtitle Engine Description + +Currently, the software comes with 1 subtitle engine, and 2 new engines are being planned. The details of these engines are as follows. + +### Gummy Subtitle Engine (Cloud-based) + +Developed based on the [Gummy Speech Translation Large Model](https://help.aliyun.com/zh/model-studio/gummy-speech-recognition-translation/) from Tongyi Lab, this cloud-based model is invoked through the API provided by [Aliyun Bailing](https://bailian.console.aliyun.com). + +**Model Detailed Parameters:** + +- Supported audio sampling rates: 16kHz and above +- Audio bit depth: 16bit +- Supported audio channels: Mono +- Recognizable languages: Chinese, English, Japanese, Korean, German, French, Russian, Italian, Spanish +- Supported translations: + - Chinese → English, Japanese, Korean + - English → Chinese, Japanese, Korean + - Japanese, Korean, German, French, Russian, Italian, Spanish → Chinese or English + +**Network Traffic Consumption:** + +The subtitle engine uses the native sampling rate (assuming 48kHz) for sampling, with a sample bit depth of 16bit and single-channel audio, so the upload rate is approximately: + +$$ +48000\, \text{samples/second} \times 2\,\text{bytes/sample} \times 1\, \text{channel} = 93.75\,\text{KB/s} +$$ + +The traffic consumption for returning the model results is relatively small and can be disregarded. + +### Vosk Subtitle Engine (Local) + +Expected to be developed based on [vosk-api](https://github.com/alphacep/vosk-api), currently under experimentation. + +### FunASR Subtitle Engine (Local) + +If feasible, it will be developed based on [FunASR](https://github.com/modelscope/FunASR). Research and feasibility verification have not yet been conducted. + + ## 🚀 Project Execution ![](./assets/media/structure_en.png) diff --git a/README_ja.md b/README_ja.md index 1a23ee9..9fcd570 100644 --- a/README_ja.md +++ b/README_ja.md @@ -24,7 +24,7 @@ [プロジェクト API ドキュメント(中国語)](./docs/api-docs/electron-ipc.md) -### 基本的な使用方法 +## 📖 基本的な使用方法 現在、Windows プラットフォーム向けのインストール可能なバージョンのみ提供されています。デフォルトの Gummy 字幕エンジンを使用する場合、まず Alibaba Cloud 百煉プラットフォームの API キーを取得し、環境変数に設定する必要があります。これによりモデルが正常に動作します。 @@ -49,6 +49,47 @@ - Linux プラットフォームでは、現在マイク入力の字幕生成のみがサポートされています。 - 現在、macOS プラットフォームには対応していません。 +以下是你选择的内容翻译成日语的结果: + +--- + +## ⚙️ 搭載字幕エンジンの説明 + +現在のソフトウェアには 1 つの字幕エンジンが搭載されており、新しい 2 つのエンジンが計画されています。それぞれの詳細情報は以下の通りです。 + +### Gummy 字幕エンジン(クラウド) + +通義実験室の [Gummy音声翻訳大規模モデル](https://help.aliyun.com/zh/model-studio/gummy-speech-recognition-translation/) を基に開発され、[阿里云百煉](https://bailian.console.aliyun.com) の API 経由でこのクラウドモデルを呼び出します。 + +**モデルの詳細パラメータ:** + +- 音声サンプリングレートのサポート:16kHz以上 +- 音声サンプル深度:16bit +- 音声チャンネル数のサポート:シングルチャンネル +- 識別可能な言語:中国語、英語、日本語、韓国語、ドイツ語、フランス語、ロシア語、イタリア語、スペイン語 +- サポートする翻訳: + - 中国語 → 英語、日本語、韓国語 + - 英語 → 中国語、日本語、韓国語 + - 日本語、韓国語、ドイツ語、フランス語、ロシア語、イタリア語、スペイン語 → 中国語または英語 + +**ネットワークトラフィック消費量:** + +字幕エンジンはネイティブサンプリングレート(48kHzと仮定)を使用してサンプリングを行い、サンプル深度は16bitであり、アップロードされる音声はシングルチャンネルであるため、アップロード速度は約: + +$$ +48000\, \text{samples/second} \times 2\,\text{bytes/sample} \times 1\, \text{channel} = 93.75\,\text{KB/s} +$$ + +モデルからの結果返送によるトラフィック消費は小さく、考慮する必要はありません。 + +### Vosk 字幕エンジン(ローカル) + +[vosk-api](https://github.com/alphacep/vosk-api) をベースにした開発を予定しており、現在試験段階にあります。 + +### FunASR 字幕エンジン(ローカル) + +可能であれば、[FunASR](https://github.com/modelscope/FunASR) をベースに開発を行う予定です。まだ調査および実現可能性の検証が行われていません。 + ## 🚀 プロジェクトの実行 ![](./assets/media/structure_ja.png) diff --git a/docs/TODO.md b/docs/TODO.md index 511a829..e4b5841 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -4,11 +4,14 @@ - [x] 添加暗色主题 *2025/07/04* - [x] 优化长字幕显示效果 *2025/07/05* - [x] 修复字幕引擎空置报错的问题 *2025/07/05* +- [x] 增强字幕窗口顶置优先级 *2025/07/07* ## 待完成 - [ ] 添加复制字幕到剪贴板功能 +- [ ] 添加字幕文字描边 - [ ] 添加本地字幕引擎 +- [ ] 添加对自带字幕引擎的详细规格说明 - [ ] 减小软件不必要的体积 ## 遥远的未来 diff --git a/engine-test/resample.ipynb b/engine-test/resample.ipynb index 798a925..2177c51 100644 --- a/engine-test/resample.ipynb +++ b/engine-test/resample.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "1e12f3ef", "metadata": {}, "outputs": [ @@ -33,7 +33,6 @@ "source": [ "import sys\n", "import os\n", - "import pyaudio\n", "import wave\n", "\n", "current_dir = os.getcwd() \n", diff --git a/src/main/CaptionWindow.ts b/src/main/CaptionWindow.ts index ea04d04..77adb75 100644 --- a/src/main/CaptionWindow.ts +++ b/src/main/CaptionWindow.ts @@ -16,7 +16,6 @@ class CaptionWindow { show: false, frame: false, transparent: true, - alwaysOnTop: true, center: true, autoHideMenuBar: true, ...(process.platform === 'linux' ? { icon } : {}), @@ -26,6 +25,8 @@ class CaptionWindow { } }) + this.window.setAlwaysOnTop(true, 'screen-saver') + this.window.on('ready-to-show', () => { this.window?.show() }) @@ -72,7 +73,8 @@ class CaptionWindow { ipcMain.on('caption.pin.set', (_, pinned) => { if(this.window){ - this.window.setAlwaysOnTop(pinned) + if(pinned) this.window.setAlwaysOnTop(true, 'screen-saver') + else this.window.setAlwaysOnTop(false) } }) }