release v0.2.0

- 更新和增加文档
- 添加新的图片
- 优化文档结构和内容
This commit is contained in:
himeditator
2025-07-05 17:11:25 +08:00
parent 50ea9c5e4c
commit 213426dace
32 changed files with 609 additions and 93 deletions

49
docs/CHANGELOG.md Normal file
View File

@@ -0,0 +1,49 @@
## v0.0.1
2025-06-22
发布第一版软件。
## v0.1.0
2025-06-26
### 新增功能
- 添加错误通知
- 添加默认引擎的环境变量检查
- 添加配置数据文件保存和载入
- 添加字幕样式恢复默认的选项
- 添加项目关于信息
### 新增文档
- 添加用户说明文档
- 添加字幕引擎说明文档
## v0.2.0
2025-07-05
对项目进行了重构,修复了 bug添加了新功能。本版本为正式版。
### 新增功能
- 添加多界面语言支持(中文、英语、日语)
- 添加暗色主题
### 提升体验
- 优化界面布局
- 添加更多可保存和载入的配置项
- 为字幕引擎添加更严格的状态限制,防止出现僵尸进程
### 修复bug
- 添加字幕引擎长时间空置后报错的问题
### 新增文档
- 新增日语说明文档
- 新增英语、日语字幕引擎说明文档和用户手册
- 新增 electron ipc api 文档

6
docs/TODO.md Normal file
View File

@@ -0,0 +1,6 @@
- [x] 添加英语和日语语言支持 *2025/07/04*
- [x] 添加暗色主题 *2025/07/04*
- [x] 优化长字幕显示效果 *2025/07/05*
- [x] 修复字幕引擎空置报错的问题 *2025/07/05*
- [ ] 添加更多字幕引擎
- [ ] 减小软件体积

View File

@@ -0,0 +1,289 @@
# electron ipc api-doc
本文档主要记录主进程和渲染进程的通信约定。
## 命名方式
本项目渲染进程包含两个:字幕窗口和控制窗口,主进程需要分别和两者进行通信。通信命令的命名规则如下:
1. 命令一般由三个关键字组成,由点号隔开。
2. 第一个关键字表示通信发送目标:
- `config` 表示控制窗口类实例(后端)或控制窗口(前端)
- `engine` 表示字幕窗口类实例(后端)或字幕窗口(前端)
- `both` 表示上述对象都有可能成为目标
3. 第二个关键字表示需要修改的对象 / 发生改变的对象,采用小驼峰命名
4. 第三个关键字一般是动词,表示通信发生时对应动作 / 需要进行的操作
根据上面的描述可以看出通信命令一般有两种语义,一种表示要求执行的操作,另一种表示当前发生的事件。
## 前端 <=> 后端
### `both.window.mounted`
**介绍:**前端窗口挂载完毕,请求最新的配置数据
**发起方:**前端
**接收方:**后端
**数据类型:**
- 发送:无数据
- 接收:`FullConfig`
### `control.nativeTheme.get`
**介绍:**前端获取系统当前的主题
**发起方:**前端控制窗口
**接收方:**后端控制窗口实例
**数据类型:**
- 发送:无数据
- 接收:`string`
## 前端 ==> 后端
### `control.uiLanguage.change`
**介绍:**前端修改字界面语言,将修改同步给后端
**发起方:**前端控制窗口
**接收方:**后端控制窗口实例
**数据类型:**`UILanguage`
### `control.uiTheme.change`
**介绍:**前端修改字界面主题,将修改同步给后端
**发起方:**前端控制窗口
**接收方:**后端控制窗口实例
**数据类型:**`UITheme`
### `control.leftBarWidth.change`
**介绍:**前端修改边栏宽度,将修改同步给后端
**发起方:**前端控制窗口
**接收方:**后端控制窗口实例
**数据类型:**`number`
### `control.captionLog.clear`
**介绍:**清空字幕记录
**发起方:**前端控制窗口
**接收方:**后端控制窗口实例
**数据类型:**无数据
### `control.styles.change`
**介绍:**前端修改字幕样式,将修改同步给后端
**发起方:**前端控制窗口
**接收方:**后端控制窗口实例
**数据类型:**`Styles`
### `control.styles.reset`
**介绍:**将字幕样式恢复为默认
**发起方:**前端控制窗口
**接收方:**后端控制窗口实例
**数据类型:**无数据
### `control.controls.change`
**介绍:**前端修改了字幕引擎配置,将最新配置发送给后端
**发起方:**前端控制窗口
**接收方:**后端控制窗口实例
**数据类型:**`Controls`
### `control.captionWindow.activate`
**介绍:**激活字幕窗口
**发起方:**前端控制窗口
**接收方:**后端控制窗口实例
**数据类型:**无数据
### `control.engine.start`
**介绍:**启动字幕引擎
**发起方:**前端控制窗口
**接收方:**后端控制窗口实例
**数据类型:**无数据
### `control.engine.stop`
**介绍:**关闭字幕引擎
**发起方:**前端控制窗口
**接收方:**后端控制窗口实例
**数据类型:**无数据
### `caption.windowHeight.change`
**介绍:**字幕窗口宽度发生改变
**发起方:**前端字幕窗口
**接收方:**后端字幕窗口实例
**数据类型:**`number`
### `caption.pin.set`
**介绍:**是否将窗口置顶
**发起方:**前端字幕窗口
**接收方:**后端字幕窗口实例
**数据类型:**`boolean`
### `caption.controlWindow.activate`
**介绍:**激活控制窗口
**发起方:**前端字幕窗口
**接收方:**后端字幕窗口实例
**数据类型:**无数据
### `caption.window.close`
**介绍:**关闭字幕窗口
**发起方:**前端字幕窗口
**接收方:**后端字幕窗口实例
**数据类型:**无数据
## 后端 ==> 前端
### `control.uiLanguage.set`
**介绍:**后端将最新界面语言发送给前端,前端进行设置
**发起方:**后端
**接收方:**字幕窗口
**数据类型:**`UILanguage`
### `control.nativeTheme.change`
**介绍:**系统主题发生改变
**发起方:**后端
**接收方:**前端控制窗口
**数据类型:**`string`
### `control.engine.started`
**介绍:**引擎启动成功
**发起方:**后端
**接收方:**前端控制窗口
**数据类型:**无数据
### `control.engine.stopped`
**介绍:**引擎关闭
**发起方:**后端
**接收方:**前端控制窗口
**数据类型:**无数据
### `control.error.occurred`
**介绍:**发送错误
**发起方:**后端
**接收方:**前端控制窗口
**数据类型:**`string`
### `control.controls.set`
**介绍:**后端将最新字幕引擎配置发送给前端,前端进行设置
**发起方:**后端
**接收方:**前端控制窗口
**数据类型:**`Controls`
### `both.styles.set`
**介绍:**后端将最新字幕样式发送给前端,前端进行设置
**发起方:**后端
**接收方:**前端
**数据类型:**`Styles`
### `both.captionLog.add`
**介绍:**添加一条新的字幕数据
**发起方:**后端
**接收方:**前端
**数据类型:**`CaptionItem`
### `both.captionLog.upd`
**介绍:**更新最后一条字幕数据
**发起方:**后端
**接收方:**前端
**数据类型:**`CaptionItem`
### `both.captionLog.set`
**介绍:**设置全部的字幕数据
**发起方:**后端
**接收方:**前端
**数据类型:**`CaptionItem[]`

116
docs/engine-manual/en.md Normal file
View File

@@ -0,0 +1,116 @@
# Caption Engine Documentation
![](../../assets/media/structure_en.png)
## Introduction to the Caption Engine
The so-called caption engine is actually a subprocess that fetches real-time streaming audio data from system audio input (recording) or output (playing sound) and calls an audio-to-text model to generate captions for the corresponding audio. The generated captions are converted into JSON formatted string data and passed to the main program via standard output (it must be ensured that the string read by the main program can be correctly interpreted as a JSON object). The main program reads and interprets the caption data, processes it, and displays it on the window.
## Features the Caption Engine Needs to Implement
### Audio Acquisition
First, your caption engine needs to acquire streaming audio data from system audio input (recording) or output (playing sound). If developing with Python, you can use the PyAudio library to get microphone audio input data (cross-platform). Use the PyAudioWPatch library to get system audio output (only applicable to Windows platform).
The acquired audio stream data is usually in the form of short audio chunks, and the size of these chunks should be adjusted according to the model. For example, Alibaba Cloud's Gummy model performs better with 0.05-second audio chunks than with 0.2-second audio chunks.
### Audio Processing
The acquired audio stream may need preprocessing before being converted to text. For instance, Alibaba Cloud's Gummy model can only recognize single-channel audio streams, while the collected audio streams are generally dual-channel, so you need to convert the dual-channel audio stream to a single channel. The conversion of channels can be achieved using methods from the NumPy library.
You can directly use the audio acquisition and processing modules I've developed (path: `caption-engine/sysaudio`):
```python
if sys.platform == 'win32':
from sysaudio.win import AudioStream, mergeStreamChannels
elif sys.platform == 'linux':
from sysaudio.linux import AudioStream, mergeStreamChannels
else:
raise NotImplementedError(f"Unsupported platform: {sys.platform}")
# Create an instance of the audio stream object
stream = AudioStream(audio_type)
# Open the audio stream
stream.openStream()
while True: # Loop to read audio data
# Read audio data
data = stream.stream.read(stream.CHUNK)
# Convert dual-channel audio data to single-channel
data = mergeStreamChannels(data, stream.CHANNELS)
# Call the audio-to-text model
# ... ...
```
### Audio to Text Conversion
Once you have the appropriate audio stream, you can convert it to text. Various models are typically used to achieve this. You can choose the model based on your requirements.
### Data Transmission
After obtaining the text for the current audio stream, you need to pass the text to the main program. The caption engine process passes the caption data to the Electron main process through standard output.
The content transmitted must be a JSON string, where the JSON object should include the following parameters:
```typescript
export interface CaptionItem {
index: number, // Caption sequence number
time_s: string, // Start time of the current caption
time_t: string, // End time of the current caption
text: string, // Caption content
translation: string // Caption translation
}
```
**It is essential to ensure that every time a caption JSON data is output, the buffer is flushed, ensuring that the string received by the Electron main process each time can be interpreted as a JSON object.**
If using Python, you can refer to the following method to pass data to the main program:
```python
# caption-engine\main-gummy.py
sys.stdout.reconfigure(line_buffering=True)
# caption-engine\audio2text\gummy.py
...
def send_to_node(self, data):
"""
Send data to the Node.js process
"""
try:
json_data = json.dumps(data) + '\n'
sys.stdout.write(json_data)
sys.stdout.flush()
except Exception as e:
print(f"Error sending data to Node.js: {e}", file=sys.stderr)
...
```
The code for the data receiving end is as follows:
```typescript
// src\main\utils\engine.ts
...
this.process.stdout.on('data', (data) => {
const lines = data.toString().split('\n');
lines.forEach((line: string) => {
if (line.trim()) {
try {
const caption = JSON.parse(line);
addCaptionLog(caption);
} catch (e) {
controlWindow.sendErrorMessage('Cannot parse caption engine output as JSON object: ' + e)
console.error('[ERROR] Error parsing JSON:', e);
}
}
});
});
this.process.stderr.on('data', (data) => {
controlWindow.sendErrorMessage('Caption engine error: ' + data)
console.error(`[ERROR] Subprocess Error: ${data}`);
});
...
```
## Code Reference
The default caption engine entry point code is located in the `main-gummy.py` file under the `caption-engine` folder of this project. The `src\main\utils\engine.ts` file contains the server-side code for acquiring and processing caption engine data. You can read and understand the implementation details and the complete runtime process of the caption engine as needed.

118
docs/engine-manual/ja.md Normal file
View File

@@ -0,0 +1,118 @@
# キャプションエンジンの説明文書
![](../../assets/media/structure_ja.png)
この文書は大規模モデルを使用して翻訳されていますので、内容に正確でない部分があるかもしれません。
## キャプションエンジンの紹介
キャプションエンジンとは、実際にはサブプログラムであり、システムの音声入力録音または出力音声再生のストリーミングデータをリアルタイムで取得し、音声をテキストに変換するモデルを呼び出して対応する音声のキャプションを生成します。生成されたキャプションはJSON形式の文字列データに変換され、標準出力を通じてメインプログラムに渡されますメインプログラムが読み取った文字列がJSONオブジェクトとして正しく解釈できるようにする必要があります。メインプログラムはキャプションデータを読み取り、解釈し、処理してウィンドウ上に表示します。
## キャプションエンジンが必要とする機能
### 音声の取得
まず、あなたのキャプションエンジンはシステムの音声入力録音または出力音声再生のストリーミングデータを取得する必要があります。Pythonを使用して開発する場合、PyAudioライブラリを使用してマイクからの音声入力データを取得できます全プラットフォーム対応。PyAudioWPatchライブラリを使用してシステムの音声出力を取得することができますWindowsプラットフォームのみ対応
一般的に取得される音声ストリームデータは、比較的短い時間の音声ブロックで構成されています。モデルに合わせて音声ブロックのサイズを調整する必要があります。例えば、アリババクラウドのGummyモデルでは、0.05秒の音声ブロックを使用した認識精度が0.2秒の音声ブロックよりも優れています。
### 音声の処理
取得した音声ストリームは、テキストに変換する前に前処理を行う必要があるかもしれません。例えば、アリババクラウドのGummyモデルは単一チャンネルの音声ストリームしか認識できませんが、収集された音声ストリームは通常二重チャンネルです。そのため、二重チャンネルの音声ストリームを単一チャンネルに変換する必要があります。チャンネル数の変換はNumPyライブラリのメソッドを使用して行うことができます。
既に開発済みの音声取得と音声処理モジュール(パス:`caption-engine/sysaudio`)を使用することもできます:
```python
if sys.platform == 'win32':
from sysaudio.win import AudioStream, mergeStreamChannels
elif sys.platform == 'linux':
from sysaudio.linux import AudioStream, mergeStreamChannels
else:
raise NotImplementedError(f"サポートされていないプラットフォーム: {sys.platform}")
# 音声ストリームオブジェクトのインスタンスを作成
stream = AudioStream(audio_type)
# 音声ストリームを開く
stream.openStream()
while True: # 音声データを繰り返し読み込む
# 音声データを読み込む
data = stream.stream.read(stream.CHUNK)
# 二重チャンネルの音声データを単一チャンネルに変換
data = mergeStreamChannels(data, stream.CHANNELS)
# 音声をテキストに変換するモデルを呼び出す
# ... ...
```
### 音声からテキストへの変換
適切な音声ストリームを得た後、それをテキストに変換することができます。通常、様々なモデルを使用してこの変換を行います。必要に応じてモデルを選択してください。
### データの伝送
現在の音声ストリームのテキストを取得したら、それをメインプログラムに伝送する必要があります。キャプションエンジンプロセスは標準出力を通じてキャプションデータをElectronのメインプロセスに伝送します。
伝送する内容はJSON文字列でなければならず、JSONオブジェクトには以下のパラメータを含める必要があります
```typescript
export interface CaptionItem {
index: number, // キャプション番号
time_s: string, // 現在のキャプションの開始時間
time_t: string, // 現在のキャプションの終了時間
text: string, // キャプションの内容
translation: string // キャプションの翻訳
}
```
**注意キャプションJSONデータを出力するたびに必ずバッファをフラッシュし、Electronのメインプロセスが受け取る文字列が常にJSONオブジェクトとして解釈できるようにする必要があります。**
Pythonを使用する場合、以下のようにデータをメインプログラムに伝送できます
```python
# caption-engine\main-gummy.py
sys.stdout.reconfigure(line_buffering=True)
# caption-engine\audio2text\gummy.py
...
def send_to_node(self, data):
"""
データをNode.jsプロセスに送信
"""
try:
json_data = json.dumps(data) + '\n'
sys.stdout.write(json_data)
sys.stdout.flush()
except Exception as e:
print(f"Node.jsへのデータ送信エラー: {e}", file=sys.stderr)
...
```
データ受信側のコードは以下の通りです:
```typescript
// src\main\utils\engine.ts
...
this.process.stdout.on('data', (data) => {
const lines = data.toString().split('\n');
lines.forEach((line: string) => {
if (line.trim()) {
try {
const caption = JSON.parse(line);
addCaptionLog(caption);
} catch (e) {
controlWindow.sendErrorMessage('キャプションエンジンの出力内容がJSONオブジェクトとして解析できません: ' + e)
console.error('[ERROR] JSON解析エラー:', e);
}
}
});
});
this.process.stderr.on('data', (data) => {
controlWindow.sendErrorMessage('キャプションエンジンエラー: ' + data)
console.error(`[ERROR] サブプロセスエラー: ${data}`);
});
...
```
## 参考コード
本プロジェクトの `caption-engine` フォルダにある `main-gummy.py` ファイルは、デフォルトのキャプションエンジンのエントリポイントコードです。`src\main\utils\engine.ts` はサーバーサイドでキャプションエンジンのデータを取得および処理するためのコードです。必要に応じて、キャプションエンジンの実装詳細と完全な実行プロセスを理解するために読み込むことができます。

117
docs/engine-manual/zh.md Normal file
View File

@@ -0,0 +1,117 @@
# 字幕引擎说明文档
![](../../assets/media/structure_zh.png)
## 字幕引擎介绍
所谓的字幕引擎实际上是一个子程序,它会实时获取系统音频输入(录音)或输出(播放声音)的流式数据,并调用音频转文字的模型生成对应音频的字幕。生成的字幕转换为 JSON 格式的字符串数据,并通过标准输出传递给主程序(需要保证主程序读取到的字符串可以被正确解释为 JSON 对象)。主程序读取并解释字幕数据,处理后显示在窗口上。
## 字幕引擎需要实现的功能
### 音频获取
首先,你的字幕引擎需要获取系统音频输入(录音)或输出(播放声音)的流式数据。如果使用 Python 开发,可以使用 PyAudio 库获取麦克风音频输入数据(全平台通用)。使用 PyAudioWPatch 库获取系统音频输出(仅适用于 Windows 平台)。
一般获取的音频流数据实际上是一个一个的时间比较短的音频块,需要根据模型调整音频块的大小。比如阿里云的 Gummy 模型使用 0.05 秒大小的音频块识别效果优于使用 0.2 秒大小的音频块。
### 音频处理
获取到的音频流在转文字之前可能需要进行预处理。比如阿里云的 Gummy 模型只能识别单通道的音频流,而收集的音频流一般是双通道的,因此要将双通道音频流转换为单通道。通道数的转换可以使用 NumPy 库中的方法实现。
你可以直接使用我开发好的音频获取和音频处理模块(路径:`caption-engine/sysaudio`
```python
if sys.platform == 'win32':
from sysaudio.win import AudioStream, mergeStreamChannels
elif sys.platform == 'linux':
from sysaudio.linux import AudioStream, mergeStreamChannels
else:
raise NotImplementedError(f"Unsupported platform: {sys.platform}")
# 创建音频流对象实例
stream = AudioStream(audio_type)
# 打开音频流
stream.openStream()
while True: # 循环读取音频数据
# 读取音频数据
data = stream.stream.read(stream.CHUNK)
# 将双通道音频数据转换为单通道
data = mergeStreamChannels(data, stream.CHANNELS)
# 调用音频转文字模型
# ... ...
```
### 音频转文字
在得到了合适的音频流后,就可以将音频流转换为文字了。一般使用各种模型来实现音频流转文字。可根据需求自行选择模型。
### 数据传递
在获取到当前音频流的文字后,需要将文字传递给主程序。字幕引擎进程通过标准输出将字幕数据传递给 electron 主进程。
传递的内容必须是 JSON 字符串,其中 JSON 对象需要包含的参数如下:
```typescript
export interface CaptionItem {
index: number, // 字幕序号
time_s: string, // 当前字幕开始时间
time_t: string, // 当前字幕结束时间
text: string, // 字幕内容
translation: string // 字幕翻译
}
```
**注意必须确保咱们一起每输出一次字幕 JSON 数据就得刷新缓冲区,确保 electron 主进程每次接收到的字符串都可以被解释为 JSON 对象。**
如果使用 python 语言,可以参考以下方式将数据传递给主程序:
```python
# caption-engine\main-gummy.py
sys.stdout.reconfigure(line_buffering=True)
# caption-engine\audio2text\gummy.py
...
def send_to_node(self, data):
"""
将数据发送到 Node.js 进程
"""
try:
json_data = json.dumps(data) + '\n'
sys.stdout.write(json_data)
sys.stdout.flush()
except Exception as e:
print(f"Error sending data to Node.js: {e}", file=sys.stderr)
...
```
数据接收端代码如下:
```typescript
// src\main\utils\engine.ts
...
this.process.stdout.on('data', (data) => {
const lines = data.toString().split('\n');
lines.forEach((line: string) => {
if (line.trim()) {
try {
const caption = JSON.parse(line);
addCaptionLog(caption);
} catch (e) {
controlWindow.sendErrorMessage('字幕引擎输出内容无法解析为 JSON 对象:' + e)
console.error('[ERROR] Error parsing JSON:', e);
}
}
});
});
this.process.stderr.on('data', (data) => {
controlWindow.sendErrorMessage('字幕引擎错误:' + data)
console.error(`[ERROR] Subprocess Error: ${data}`);
});
...
```
## 参考代码
本项目 `caption-engine` 文件夹下的 `main-gummy.py` 文件为默认字幕引擎的入口代码。`src\main\utils\engine.ts` 为服务端获取字幕引擎数据和进行处理的代码。可以根据需要阅读了解字幕引擎的实现细节和完整运行过程。

BIN
docs/img/01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
docs/img/02_en.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
docs/img/02_ja.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
docs/img/02_zh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

60
docs/user-manual/en.md Normal file
View File

@@ -0,0 +1,60 @@
# Auto Caption User Manual
Corresponding Version: v0.2.0
## Software Introduction
Auto Caption is a cross-platform caption display software that can real-time capture system audio input (recording) or output (playback) streaming data and use an audio-to-text model to generate captions for the corresponding audio. The default caption engine provided by the software (using Alibaba Cloud Gummy model) supports recognition and translation in nine languages (Chinese, English, Japanese, Korean, German, French, Russian, Spanish, Italian).
Currently, the default caption engine only has full functionality on the Windows platform. On the Linux platform, it can only generate captions for audio input (microphone) and does not support generating captions for audio output (playback).
![](../../assets/media/main_en.png)
### Software Limitations
To use the default caption service, you need to obtain an API KEY from Alibaba Cloud.
The software is built using Electron, so the software size is inevitably large.
## Software Usage
### Preparing the Alibaba Cloud Model Studio API KEY
To use the default caption engine (Alibaba Cloud Gummy), you need to obtain an API KEY from the Alibaba Cloud Model Studio and configure it in your local environment variables.
**The international version of Alibaba Cloud does not provide the Gummy model, so non-Chinese users currently cannot use the default caption engine. I am trying to develop a new local caption engine to ensure that all users have access to a default caption engine.**
Alibaba Cloud provides detailed tutorials for this:
- [Obtain API KEY (Chinese)](https://help.aliyun.com/zh/model-studio/get-api-key)
- [Configure API Key in Environment Variables (Chinese)](https://help.aliyun.com/zh/model-studio/configure-api-key-through-environment-variables)
### Modifying Settings
Caption settings can be divided into three categories: general settings, caption engine settings, and caption style settings. Note that changes to general settings take effect immediately. For the other two categories, after making changes, you need to click the "Apply" option in the upper right corner of the corresponding settings module for the changes to take effect. If you click "Cancel Changes," the current modifications will not be saved and will revert to the previous state.
### Starting and Stopping Captions
After completing all configurations, click the "Start Caption Engine" button on the interface to start the captions. If you need a separate caption display window, click the "Open Caption Window" button to activate the independent caption display window. To pause caption recognition, click the "Stop Caption Engine" button.
### Adjusting the Caption Display Window
The following image shows the caption display window, which displays the latest captions in real-time. The three buttons in the upper right corner of the window have the following functions: pin the window to the front, open the caption control window, and close the caption display window. The width of the window can be adjusted by moving the mouse to the left or right edge of the window and dragging the mouse.
![](../img/01.png)
### Exporting Caption Records
In the caption control window, you can see the records of all collected captions. Click the "Export Caption Records" button to export the caption records as a JSON file.
## Caption Engine
The so-called caption engine is actually a subprocess that real-time captures system audio input (recording) or output (playback) streaming data and uses an audio-to-text model to generate captions for the corresponding audio. The generated captions are output as JSON data converted to strings and returned to the main program. The main program reads the caption data, processes it, and displays it in the window.
The software provides a default caption engine. If you need other caption engines, you can call them by enabling the custom engine option (other engines need to be developed specifically for this software). The engine path is the path to the custom caption engine on your computer, and the engine command is the runtime parameters for the custom caption engine, which need to be filled out according to the rules of the specific caption engine.
![](../img/02_en.png)
Note that when using a custom caption engine, all previous caption engine settings will be ineffective, and the configuration of the custom caption engine is entirely done through the engine command.
If you are a developer and want to develop a custom caption engine, please refer to the [Caption Engine Explanation Document](../engine-manual/en.md).

62
docs/user-manual/ja.md Normal file
View File

@@ -0,0 +1,62 @@
# Auto Caption ユーザーマニュアル
対応バージョンv0.2.0
この文書は大規模モデルを使用して翻訳されていますので、内容に正確でない部分があるかもしれません。
## ソフトウェアの概要
Auto Caption は、クロスプラットフォームの字幕表示ソフトウェアで、システムの音声入力(録音)または出力(音声再生)のストリーミングデータをリアルタイムで取得し、音声からテキストに変換するモデルを利用して対応する音声の字幕を生成します。このソフトウェアが提供するデフォルトの字幕エンジン(アリババクラウド Gummy モデルを使用は、9つの言語中国語、英語、日本語、韓国語、ドイツ語、フランス語、ロシア語、スペイン語、イタリア語の認識と翻訳をサポートしています。
現在、デフォルトの字幕エンジンは Windows プラットフォームでのみ完全な機能を利用できます。Linux プラットフォームでは、音声入力(マイク)からの字幕生成のみがサポートされており、音声出力(音声再生)からの字幕生成はまだサポートされていません。
![](../../assets/media/main_ja.png)
### ソフトウェアの欠点
デフォルトの字幕サービスを使用するには、アリババクラウドの API KEY を取得する必要があります。
ソフトウェアは Electron で構築されているため、そのサイズは避けられないほど大きいです。
## ソフトウェアの使用方法
### アリババクラウド百炼プラットフォームの API KEY の準備
ソフトウェアが提供するデフォルトの字幕エンジン(アリババクラウド Gummyを使用するには、アリババクラウド百炼プラットフォームから API KEY を取得し、ローカル環境変数に設定する必要があります。
**アリババクラウドの国際版には Gummy モデルが提供されていないため、中国以外のユーザーは現在、デフォルトの字幕エンジンを使用できません。すべてのユーザーが利用できるように、新しいローカルの字幕エンジンを開発中です。**
アリババクラウドは詳細なチュートリアルを提供していますので、以下のリンクを参照してください:
- [API KEY の取得(中国語)](https://help.aliyun.com/zh/model-studio/get-api-key)
- [環境変数を通じて API Key を設定する(中国語)](https://help.aliyun.com/zh/model-studio/configure-api-key-through-environment-variables)
### 設定の変更
字幕の設定は3つのカテゴリーに分かれます一般的な設定、字幕エンジンの設定、字幕スタイルの設定。注意すべき点として、一般的な設定の変更は即座に適用されます。しかし、他の2つの設定については、変更後に該当する設定モジュール右上の「適用」オプションをクリックすることで初めて変更が有効になります。「変更を取り消す」を選択すると、現在の変更は保存されず、前回の状態に戻ります。
### 字幕の開始と停止
すべての設定を完了したら、インターフェースの「字幕エンジンを開始」ボタンをクリックして字幕を開始できます。独立した字幕表示ウィンドウが必要な場合は、インターフェースの「字幕ウィンドウを開く」ボタンをクリックして独立した字幕表示ウィンドウをアクティブ化します。字幕認識を一時停止する必要がある場合は、「字幕エンジンを停止」ボタンをクリックします。
### 字幕表示ウィンドウの調整
下の図は字幕表示ウィンドウです。このウィンドウは現在の最新の字幕をリアルタイムで表示します。ウィンドウの右上にある3つのボタンの機能はそれぞれ次の通りですウィンドウを最前面に固定する、字幕制御ウィンドウを開く、字幕表示ウィンドウを閉じる。このウィンドウの幅は調整可能です。マウスをウィンドウの左右の端に移動し、ドラッグして幅を調整します。
![](../img/01.png)
### 字幕記録のエクスポート
字幕制御ウィンドウでは、現在収集されたすべての字幕の記録を見ることができます。「字幕記録をエクスポート」ボタンをクリックすると、字幕記録をJSONファイルとしてエクスポートできます。
## 字幕エンジン
字幕エンジンとは、実際にはサブプログラムであり、システムの音声入力録音または出力音声再生のストリーミングデータをリアルタイムで取得し、音声からテキストに変換するモデルを利用して対応する音声の字幕を生成します。生成された字幕はIPC経由で文字列に変換されたJSONデータとして出力され、メインプログラムに返されます。メインプログラムは字幕データを読み取り、処理してウィンドウ上に表示します。
ソフトウェアはデフォルトの字幕エンジンを提供しており、他の字幕エンジンが必要な場合は、カスタムエンジンオプションを開いて他の字幕エンジンを呼び出すことができます(他のエンジンはこのソフトウェアに対して開発する必要があります)。エンジンパスは、あなたのコンピュータ上のカスタム字幕エンジンのパスであり、エンジンコマンドはカスタム字幕エンジンの実行パラメータです。これらの部分は、その字幕エンジンの規則に従って記入する必要があります。
![](../img/02_ja.png)
カスタム字幕エンジンを使用する場合、前の字幕エンジンの設定はすべて無効になります。カスタム字幕エンジンの設定は完全にエンジンコマンドによって行われます。
開発者の方で、カスタム字幕エンジンを開発したい場合は、[字幕エンジン説明文書](../engine-manual/ja.md)をご覧ください。

61
docs/user-manual/zh.md Normal file
View File

@@ -0,0 +1,61 @@
# Auto Caption 用户手册
对应版本v0.2.0
## 软件简介
Auto Caption 是一个跨平台的字幕显示软件,能够实时获取系统音频输入(录音)或输出(播放声音)的流式数据,并调用音频转文字的模型生成对应音频的字幕。软件提供的默认字幕引擎(使用阿里云 Gummy 模型)支持九种语言(中、英、日、韩、德、法、俄、西、意)的识别与翻译。
目前软件默认字幕引擎只有在 Windows 平台下才拥有完整功能。在 Linux 平台下只能生成音频输入(麦克风)的字幕,暂不支持音频输出(播放声音)的字幕生成。
![](../../assets/media/main_zh.png)
### 软件缺点
要使用默认字幕服务需要获取阿里云的 API KEY。
软件使用 Electron 构建,因此软件体积不可避免的较大。
## 软件使用
### 准备阿里云百炼平台 API KEY
要使用软件提供的默认字幕引擎(阿里云 Gummy需要从阿里云百炼平台获取 API KEY 并在本机环境变量中配置。
**国际版的阿里云服务并没有提供 Gummy 模型,因此目前非中国用户无法使用默认字幕引擎。我正在开发新的本地字幕引擎,以确保所有用户都有默认字幕引擎可以使用。**
这部分阿里云提供了详细的教程,可参考:
- [获取 API KEY](https://help.aliyun.com/zh/model-studio/get-api-key)
- [将 API Key 配置到环境变量](https://help.aliyun.com/zh/model-studio/configure-api-key-through-environment-variables)
### 修改设置
字幕设置可以分为三类:通用设置、字幕引擎设置、字幕样式设置。需要注意的是,修改通用设置是立即生效的。但是对于其他两类设置,修改后需要点击对应设置模块右上角的“应用”选项,更改才会真正生效。如果点击“取消更改”那么当前修改将不会被保存,而是回退到上次修改的状态。
### 启动和关闭字幕
在修改完全部配置后,点击界面的“启动字幕引擎”按钮,即可启动字幕。如果需要独立的字幕展示窗口,单击界面的“打开字幕窗口”按钮即可激活独立的字幕展示窗口。如果需要暂停字幕识别,单击界面的“关闭字幕引擎”按钮即可。
### 调整字幕展示窗口
如下图为字幕展示窗口,该窗口实时展示当前最新字幕。窗口右上角三个按钮的功能分别是:将窗口固定在最前面、打开字幕控制窗口、关闭字幕展示窗口。该窗口宽度可以调整,将鼠标移动至窗口的左右边缘,拖动鼠标即可调整宽度。
![](../img/01.png)
### 字幕记录的导出
在字幕控制窗口中可以看到当前收集的所有字幕的记录,点击“导出字幕记录”按钮,即可将字幕记录导出为 JSON 文件。
## 字幕引擎
所谓的字幕引擎实际上是一个子程序,它会实时获取系统音频输入(录音)或输出(播放声音)的流式数据,并调用音频转文字的模型生成对应音频的字幕。生成的字幕通过 IPC 输出为转换为字符串的 JSON 数据,并返回给主程序。主程序读取字幕数据,处理后显示在窗口上。
软件提供了一个默认的字幕引擎,如果你需要其他的字幕引擎,可以通过打开自定义引擎选项来调用其他字幕引擎(其他引擎需要针对该软件进行开发)。其中引擎路径是自定义字幕引擎在你的电脑上的路径,引擎指令是自定义字幕引擎的运行参数,这部分需要按该字幕引擎的规则进行填写。
![](../img/02_zh.png)
注意使用自定义字幕引擎时,前面的字幕引擎的设置将全部不起作用,自定义字幕引擎的配置完全通过引擎指令进行配置。
如果你是开发者,想开发自定义字幕引擎,请查看[字幕引擎说明文档](../engine-manual/zh.md)。