feat(renderer): 修改部分页面提示、增加英文版README

This commit is contained in:
himeditator
2025-06-23 20:23:03 +08:00
parent fae8b32edf
commit c086725d98
4 changed files with 113 additions and 6 deletions

View File

@@ -2,7 +2,10 @@
<img src="./resources/icon.png" width="100px" height="100px"/> <img src="./resources/icon.png" width="100px" height="100px"/>
<h1 align="center">auto-caption</h1> <h1 align="center">auto-caption</h1>
<p>Auto Caption 是一个跨平台的字幕显示软件。</p> <p>Auto Caption 是一个跨平台的字幕显示软件。</p>
<b>项目初版已经开发完毕。</b> <p>
| <b>简体中文</b>
| <a href="https://github.com/HiMeditator/auto-caption/blob/main/README_en.md">English</a> |
</p>
</div> </div>
![](./assets/01.png) ![](./assets/01.png)

101
README_en.md Normal file
View File

@@ -0,0 +1,101 @@
<div align="center" >
<img src="./resources/icon.png" width="100px" height="100px"/>
<h1 align="center">auto-caption</h1>
<p>Auto Caption is a cross-platform subtitle display software.</p>
<p>
| <a href="https://github.com/HiMeditator/auto-caption/blob/main/README.md">简体中文</a>
| <b>English</b> |
</p>
</div>
![](./assets/01.png)
## 📥 Download
[GitHub Releases](https://github.com/HiMeditator/auto-caption/releases)
## 📚 User Manual
Not available yet.
### Basic Usage
Currently, only an installable version for the Windows platform is provided. If using the default Gummy subtitle engine, you need to obtain an API KEY from Alibaba Cloud's Bailian platform and configure it in the environment variables to use the model properly. Related tutorials: [Get API KEY](https://help.aliyun.com/zh/model-studio/get-api-key), [Configure API Key through Environment Variables](https://help.aliyun.com/zh/model-studio/configure-api-key-through-environment-variables).
For developers, you can create new subtitle engines. Please refer to the source code for specific communication specifications.
## ✨ Features
- Rich subtitle style settings
- Flexible subtitle engine selection
- Multi-language recognition and translation
- Subtitle record display and export
- Generate subtitles for audio output and microphone input
Note: The Windows platform supports generating subtitles for both audio output and microphone input, while the Linux platform only supports generating subtitles for microphone input.
## 🚀 Project Execution
### Install Dependencies
```bash
npm install
```
### Build Subtitle Engine
> #### Background
>
> The so-called subtitle engine is actually a subprocess that will real-time acquire streaming data from system audio input (recording) or output (playing sound) and call an audio-to-text model to generate corresponding subtitles for the audio. The generated subtitles are output as JSON data converted to strings via IPC and returned to the main program. The main program reads the subtitle data, processes it, and displays it on the window.
>
> Currently, the project uses the [Alibaba Cloud Gummy Model](https://help.aliyun.com/zh/model-studio/gummy-speech-recognition-translation/) by default, which requires obtaining an API KEY from Alibaba Cloud's Bailian platform and configuring it in the environment variables to function properly. Related tutorials: [Get API KEY](https://help.aliyun.com/zh/model-studio/get-api-key), [Configure API Key through Environment Variables](https://help.aliyun.com/zh/model-studio/configure-api-key-through-environment-variables).
>
> The gummy subtitle engine in this project is a Python subprocess, packaged into an executable file using pyinstaller. The code for running the subtitle engine subprocess is in the `src\main\utils\engine.ts` file.
First, enter the `python-subprocess` folder and execute the following command to create a virtual environment:
```bash
python -m venv subenv
```
Then activate the virtual environment:
```bash
# Windows
subenv/Scripts/activate
# Linux
source subenv/bin/activate
```
Then install the dependencies (note that if you are in a Linux environment, you need to comment out `PyAudioWPatch` in `requirements.txt`, as this module is only applicable to the Windows environment):
```bash
pip install -r requirements.txt
```
Then build the project using `pyinstaller`:
```bash
pyinstaller --onefile main-gummy.py
```
At this point, the project is built. You can find the corresponding executable file in the `python-subprocess/dist` folder. You can proceed with further operations.
### Run the Project
```bash
npm run dev
```
### Build the Project
Please note that the software is not currently adapted for macOS. Use Windows or Linux systems for building.
```bash
# For Windows
npm run build:win
# For macOS
npm run build:mac
# For Linux
npm run build:linux
```

View File

@@ -2,7 +2,7 @@
<div class="caption-stat"> <div class="caption-stat">
<a-row> <a-row>
<a-col :span="6"> <a-col :span="6">
<a-statistic title="字幕引擎" :value="engine" /> <a-statistic title="字幕引擎" :value="(customized && customizedApp)?'自定义':engine" />
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<a-statistic title="字幕引擎状态" :value="engineEnabled?'已启动':'未启动'" /> <a-statistic title="字幕引擎状态" :value="engineEnabled?'已启动':'未启动'" />
@@ -81,7 +81,7 @@ import { useCaptionControlStore } from '@renderer/stores/captionControl'
const captionLog = useCaptionLogStore() const captionLog = useCaptionLogStore()
const { captionData } = storeToRefs(captionLog) const { captionData } = storeToRefs(captionLog)
const captionControl = useCaptionControlStore() const captionControl = useCaptionControlStore()
const { engineEnabled, engine } = storeToRefs(captionControl) const { engineEnabled, engine, customized, customizedApp } = storeToRefs(captionControl)
const pagination = ref({ const pagination = ref({
current: 1, current: 1,
pageSize: 10, pageSize: 10,

View File

@@ -90,11 +90,14 @@ export const useCaptionControlStore = defineStore('captionControl', () => {
window.electron.ipcRenderer.on('control.engine.started', () => { window.electron.ipcRenderer.on('control.engine.started', () => {
engineEnabled.value = true engineEnabled.value = true
const str0 =
`原语言:${sourceLang.value},是否翻译:${translation.value?'是':'否'}` +
`字幕引擎:${engine.value},音频类型:${audio.value ? '输入音频' : '输出音频'}` +
(translation.value ? `,翻译语言:${targetLang.value}` : '');
const str1 = `类型:自定义引擎,引擎路径:${customizedApp.value},命令参数:${customizedCommand.value}`;
notification.open({ notification.open({
message: '字幕引擎启动', message: '字幕引擎启动',
description: `原语言:${sourceLang.value},是否翻译:${translation.value?'是':'否'}` + description: (customized.value && customizedApp.value) ? str1 : str0
`字幕引擎:${engine.value},音频类型:${audio.value ? '输入音频' : '输出音频'}` +
(translation.value ? `,翻译语言:${targetLang.value}` : '')
}); });
}) })