diff --git a/README.md b/README.md index 471b462..da90248 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@

auto-caption

Auto Caption 是一个跨平台的实时字幕显示软件。

+ + + + +

| 简体中文 | English diff --git a/README_en.md b/README_en.md index 25ca556..f096e68 100644 --- a/README_en.md +++ b/README_en.md @@ -2,6 +2,11 @@

auto-caption

Auto Caption is a cross-platform real-time caption display software.

+ + + + +

| 简体中文 | English diff --git a/README_ja.md b/README_ja.md index 0d4b4f6..1044014 100644 --- a/README_ja.md +++ b/README_ja.md @@ -2,6 +2,11 @@

auto-caption

Auto Caption はクロスプラットフォームのリアルタイム字幕表示ソフトウェアです。

+ + + + +

| 简体中文 | English diff --git a/assets/media/main_en.png b/assets/media/main_en.png index 4d92d44..b0fa27a 100644 Binary files a/assets/media/main_en.png and b/assets/media/main_en.png differ diff --git a/assets/media/main_ja.png b/assets/media/main_ja.png index ffd41e4..17c24cc 100644 Binary files a/assets/media/main_ja.png and b/assets/media/main_ja.png differ diff --git a/assets/media/main_zh.png b/assets/media/main_zh.png index af40eab..f7eaaa1 100644 Binary files a/assets/media/main_zh.png and b/assets/media/main_zh.png differ diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4caaf21..07758b2 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -29,6 +29,7 @@ ### 新增功能 +- 添加长字幕内容隐藏功能 (#1) - 添加多界面语言支持(中文、英语、日语) - 添加暗色主题 @@ -40,7 +41,7 @@ ### 修复bug -- 添加字幕引擎长时间空置后报错的问题 +- 添加字幕引擎长时间空置后报错的问题 (#2) ### 新增文档 @@ -48,63 +49,26 @@ - 新增英语、日语字幕引擎说明文档和用户手册 - 新增 electron ipc api 文档 +## v0.3.0 +2025-07-09 +对字幕引擎代码进行了重构,软件适配了 macOS 平台,添加了新功能。 -Here are the translations of the selected macOS audio output configuration section: +### 新增功能 -### English Translation: -```markdown -### Capturing System Audio Output on macOS +- 添加软件内设置 API KEY 的功能 +- 添加字幕字体粗细和文本阴影的设置 +- 添加复制字幕记录到剪贴板的功能 (#3) -The subtitle engine cannot directly capture system audio output on macOS platform and requires additional driver installation. The current subtitle engine uses [BlackHole](https://github.com/ExistentialAudio/BlackHole). First open Terminal and execute one of the following commands (recommended to choose the first one): +### 优化体验 -```bash -brew install blackhole-2ch -brew install blackhole-16ch -brew install blackhole-64ch -``` +- 字幕时间记录精确到毫秒 +- 更详细的说明文档(添加字幕引擎规格说明、用户文档和字幕引擎文档更新) (#4) +- 适配 macOS 平台 +- 字幕窗口有了更大的顶置优先级 +- 预览窗口可以实时显示最新的字幕内容 -After installation completes, open `Audio MIDI Setup` (searchable via `cmd + space`). Check if BlackHole appears in the device list - if not, restart your computer. +### 修复bug -Once BlackHole is confirmed installed, in the `Audio MIDI Setup` page, click the plus (+) button at bottom left and select "Create Multi-Output Device". Include both BlackHole and your desired audio output destination in the outputs. Finally, set this multi-output device as your default audio output device. - -Now the subtitle engine can capture system audio output and generate subtitles. -``` - -### Japanese Translation: -```markdown -### macOSでのシステムオーディオ出力の取得方法 - -字幕エンジンはmacOSプラットフォームで直接システムオーディオ出力を取得できず、追加のドライバーインストールが必要です。現在の字幕エンジンでは[BlackHole](https://github.com/ExistentialAudio/BlackHole)を使用しています。まずターミナルを開き、以下のいずれかのコマンドを実行してください(最初のオプションを推奨します): - -```bash -brew install blackhole-2ch -brew install blackhole-16ch -brew install blackhole-64ch -``` - -インストール完了後、`オーディオMIDI設定`(`cmd + space`で検索可能)を開きます。デバイスリストにBlackHoleが表示されているか確認してください - 表示されていない場合はコンピュータを再起動してください。 - -BlackHoleのインストールが確認できたら、`オーディオMIDI設定`ページで左下のプラス(+)ボタンをクリックし、「マルチ出力デバイスを作成」を選択します。出力にBlackHoleと希望するオーディオ出力先の両方を含めてください。最後に、このマルチ出力デバイスをデフォルトのオーディオ出力デバイスに設定します。 - -これで字幕エンジンがシステムオーディオ出力をキャプチャし、字幕を生成できるようになります。 -``` - -Key translation notes: -1. Technical terms: - - "Audio MIDI Setup" → "オーディオMIDI設定" (Japanese) - - "Multi-Output Device" → "マルチ出力デバイス" (Japanese) - - Maintained "BlackHole" and "brew" commands as-is - -2. Structure: - - Kept the same section hierarchy with ### headers - - Preserved all code blocks and formatting - - Maintained the step-by-step instruction flow - -3. Localization: - - Used appropriate Japanese technical terms - - Adjusted phrasing for natural reading in each language - - Kept all terminal commands and interface elements unchanged - -Both translations accurately convey the technical procedures while adapting naturally to their target languages. \ No newline at end of file +- 修复使用系统主题时暗色系统载入为亮色的问题 diff --git a/docs/TODO.md b/docs/TODO.md index fac6d76..c6f58c5 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -8,10 +8,10 @@ - [x] 添加对自带字幕引擎的详细规格说明 *2025/07/07* - [x] 添加复制字幕到剪贴板功能 *2025/07/08* - [x] 适配 macOS 平台 *2025/07/08* +- [x] 添加字幕文字描边 *2025/07/09* ## 待完成 -- [ ] 添加字幕文字描边 - [ ] 添加本地字幕引擎 - [ ] 添加基于 Vosk 的字幕引擎 - [ ] 验证 / 添加基于 FunASR 的字幕引擎 diff --git a/docs/img/03.png b/docs/img/03.png new file mode 100644 index 0000000..7d96057 Binary files /dev/null and b/docs/img/03.png differ diff --git a/docs/img/04.png b/docs/img/04.png new file mode 100644 index 0000000..18d693b Binary files /dev/null and b/docs/img/04.png differ diff --git a/docs/img/05.png b/docs/img/05.png new file mode 100644 index 0000000..43b5e1e Binary files /dev/null and b/docs/img/05.png differ diff --git a/docs/user-manual/en.md b/docs/user-manual/en.md index cefc49b..d75efae 100644 --- a/docs/user-manual/en.md +++ b/docs/user-manual/en.md @@ -35,6 +35,8 @@ Alibaba Cloud provides detailed tutorials for this: ### Capturing System Audio Output on macOS +> Based on the [Setup Multi-Output Device](https://github.com/ExistentialAudio/BlackHole/wiki/Multi-Output-Device) tutorial + The caption engine cannot directly capture system audio output on macOS platform and requires additional driver installation. The current caption engine uses [BlackHole](https://github.com/ExistentialAudio/BlackHole). First open Terminal and execute one of the following commands (recommended to choose the first one): ```bash @@ -43,10 +45,16 @@ brew install blackhole-16ch brew install blackhole-64ch ``` +![](../img/03.png) + After installation completes, open `Audio MIDI Setup` (searchable via `cmd + space`). Check if BlackHole appears in the device list - if not, restart your computer. +![](../img/04.png) + Once BlackHole is confirmed installed, in the `Audio MIDI Setup` page, click the plus (+) button at bottom left and select "Create Multi-Output Device". Include both BlackHole and your desired audio output destination in the outputs. Finally, set this multi-output device as your default audio output device. +![](../img/05.png) + Now the caption engine can capture system audio output and generate captions. ### Modifying Settings diff --git a/docs/user-manual/ja.md b/docs/user-manual/ja.md index 0831631..58adc82 100644 --- a/docs/user-manual/ja.md +++ b/docs/user-manual/ja.md @@ -37,6 +37,9 @@ macOS プラットフォームでオーディオ出力を取得するには追 ### macOS でのシステムオーディオ出力の取得方法 +> [マルチ出力デバイスの設定](https://github.com/ExistentialAudio/BlackHole/wiki/Multi-Output-Device) チュートリアルに基づいて作成 + + 字幕エンジンは macOS プラットフォームで直接システムオーディオ出力を取得できず、追加のドライバーインストールが必要です。現在の字幕エンジンでは [BlackHole](https://github.com/ExistentialAudio/BlackHole) を使用しています。まずターミナルを開き、以下のいずれかのコマンドを実行してください(最初のオプションを推奨します): ```bash @@ -45,10 +48,16 @@ brew install blackhole-16ch brew install blackhole-64ch ``` +![](../img/03.png) + インストール完了後、`オーディオMIDI設定`(`cmd + space`で検索可能)を開きます。デバイスリストにBlackHoleが表示されているか確認してください - 表示されていない場合はコンピュータを再起動してください。 +![](../img/04.png) + BlackHoleのインストールが確認できたら、`オーディオ MIDI 設定`ページで左下のプラス(+)ボタンをクリックし、「マルチ出力デバイスを作成」を選択します。出力に BlackHole と希望するオーディオ出力先の両方を含めてください。最後に、このマルチ出力デバイスをデフォルトのオーディオ出力デバイスに設定します。 +![](../img/05.png) + これで字幕エンジンがシステムオーディオ出力をキャプチャし、字幕を生成できるようになります。 ### 設定の変更 diff --git a/docs/user-manual/zh.md b/docs/user-manual/zh.md index 25472a6..1445c81 100644 --- a/docs/user-manual/zh.md +++ b/docs/user-manual/zh.md @@ -38,6 +38,8 @@ Auto Caption 是一个跨平台的字幕显示软件,能够实时获取系统 ### macOS 获取系统音频输出 +> 基于 [Setup Multi-Output Device](https://github.com/ExistentialAudio/BlackHole/wiki/Multi-Output-Device) 教程编写 + 字幕引擎无法在 macOS 平台直接获取系统的音频输出,需要安装额外的驱动。目前字幕引擎采用的是 [BlackHole](https://github.com/ExistentialAudio/BlackHole)。首先打开终端,执行以下命令中的其中一个(建议选择第一个): ```bash @@ -46,10 +48,16 @@ brew install blackhole-16ch brew install blackhole-64ch ``` +![](../img/03.png) + 安装完成后打开 `音频 MIDI 设置`(`cmd + space` 打开搜索,可以搜索到)。观察设备列表中是否有 BlackHole 设备,如果没有需要重启电脑。 +![](../img/04.png) + 在确定安装好 BlackHole 设备后,在 `音频 MIDI 设置` 页面,点击左下角的加号,选择“创建多输出设备”。在输出中包含 BlackHole 和你想要的音频输出目标。最后将该多输出设备设置为默认音频输出设备。 +![](../img/05.png) + 现在字幕引擎就能捕获系统的音频输出并生成字幕了。 ### 修改设置 diff --git a/src/main/ControlWindow.ts b/src/main/ControlWindow.ts index 3e2d7ce..62284f4 100644 --- a/src/main/ControlWindow.ts +++ b/src/main/ControlWindow.ts @@ -65,8 +65,11 @@ class ControlWindow { }) ipcMain.handle('control.nativeTheme.get', () => { - if(nativeTheme.shouldUseDarkColors) return 'dark' - return 'light' + if(allConfig.uiTheme === 'system'){ + if(nativeTheme.shouldUseDarkColors) return 'dark' + return 'light' + } + return allConfig.uiTheme }) ipcMain.on('control.uiLanguage.change', (_, args) => { diff --git a/src/main/types/index.ts b/src/main/types/index.ts index 460e634..9bdb881 100644 --- a/src/main/types/index.ts +++ b/src/main/types/index.ts @@ -20,13 +20,20 @@ export interface Styles { fontFamily: string, fontSize: number, fontColor: string, + fontWeight: number, background: string, opacity: number, showPreview: boolean, transDisplay: boolean, transFontFamily: string, transFontSize: number, - transFontColor: string + transFontColor: string, + transFontWeight: number, + textShadow: boolean, + offsetX: number, + offsetY: number, + blur: number, + textShadowColor: string } export interface CaptionItem { diff --git a/src/main/utils/AllConfig.ts b/src/main/utils/AllConfig.ts index 74204e3..8d16045 100644 --- a/src/main/utils/AllConfig.ts +++ b/src/main/utils/AllConfig.ts @@ -11,13 +11,20 @@ const defaultStyles: Styles = { fontFamily: 'sans-serif', fontSize: 24, fontColor: '#000000', + fontWeight: 4, background: '#dbe2ef', opacity: 80, showPreview: true, transDisplay: true, transFontFamily: 'sans-serif', transFontSize: 24, - transFontColor: '#000000' + transFontColor: '#000000', + transFontWeight: 4, + textShadow: false, + offsetX: 2, + offsetY: 2, + blur: 0, + textShadowColor: '#ffffff' }; const defaultControls: Controls = { diff --git a/src/renderer/src/assets/input.css b/src/renderer/src/assets/input.css index 0a90e98..018e1de 100644 --- a/src/renderer/src/assets/input.css +++ b/src/renderer/src/assets/input.css @@ -11,6 +11,8 @@ .switch-label { display: inline-block; + min-width: 80px; + text-align: right; margin-right: 10px; } diff --git a/src/renderer/src/components/CaptionStyle.vue b/src/renderer/src/components/CaptionStyle.vue index 3b9e067..6ed642f 100644 --- a/src/renderer/src/components/CaptionStyle.vue +++ b/src/renderer/src/components/CaptionStyle.vue @@ -22,6 +22,7 @@ v-model:value="currentFontFamily" /> +

{{ $t('style.fontColor') }}
{{ currentFontSize }}px
+
+ {{ $t('style.fontWeight') }} + +
{{ currentFontWeight*100 }}
+
{{ $t('style.background') }} {{ $t('style.translation') }}
+ +
+ {{ $t('style.textShadow') }} + +
@@ -103,6 +119,60 @@ />
{{ currentTransFontSize }}px
+
+ {{ $t('style.fontWeight') }} + +
{{ currentTransFontWeight*100 }}
+
+ + + +
+ +
+ {{ $t('style.shadow.offsetX') }} + +
{{ currentOffsetX }}px
+
+
+ {{ $t('style.shadow.offsetY') }} + +
{{ currentOffsetY }}px
+
+
+ {{ $t('style.shadow.blur') }} + +
{{ currentBlur }}px
+
+
+ {{ $t('style.shadow.color') }} + +
{{ currentTextShadowColor }}
+
@@ -112,14 +182,16 @@ v-if="currentPreview" class="preview-container" :style="{ - backgroundColor: addOpicityToColor(currentBackground, currentOpacity) + backgroundColor: addOpicityToColor(currentBackground, currentOpacity), + textShadow: currentTextShadow ? `${currentOffsetX}px ${currentOffsetY}px ${currentBlur}px ${currentTextShadowColor}` : 'none' }" >

{{ captionData[captionData.length-1].text }} {{ $t('example.original') }} @@ -129,7 +201,8 @@ :style="{ fontFamily: currentTransFontFamily, fontSize: currentTransFontSize + 'px', - color: currentTransFontColor + color: currentTransFontColor, + fontWeight: currentTransFontWeight * 100 }" > {{ captionData[captionData.length-1].translation }} @@ -147,7 +220,6 @@ import { storeToRefs } from 'pinia' import { notification } from 'ant-design-vue' import { useI18n } from 'vue-i18n' import { useCaptionLogStore } from '@renderer/stores/captionLog'; - const captionLog = useCaptionLogStore(); const { captionData } = storeToRefs(captionLog); @@ -160,6 +232,7 @@ const currentLineBreak = ref(0) const currentFontFamily = ref('sans-serif') const currentFontSize = ref(24) const currentFontColor = ref('#000000') +const currentFontWeight = ref(4) const currentBackground = ref('#dbe2ef') const currentOpacity = ref(50) const currentPreview = ref(true) @@ -167,6 +240,12 @@ const currentTransDisplay = ref(true) const currentTransFontFamily = ref('sans-serif') const currentTransFontSize = ref(24) const currentTransFontColor = ref('#000000') +const currentTransFontWeight = ref(4) +const currentTextShadow = ref(false) +const currentOffsetX = ref(2) +const currentOffsetY = ref(2) +const currentBlur = ref(0) +const currentTextShadowColor = ref('#ffffff') function addOpicityToColor(color: string, opicity: number) { const opicityValue = Math.round(opicity * 255 / 100); @@ -185,6 +264,7 @@ function applyStyle(){ captionStyle.fontFamily = currentFontFamily.value; captionStyle.fontSize = currentFontSize.value; captionStyle.fontColor = currentFontColor.value; + captionStyle.fontWeight = currentFontWeight.value; captionStyle.background = currentBackground.value; captionStyle.opacity = currentOpacity.value; captionStyle.showPreview = currentPreview.value; @@ -192,6 +272,12 @@ function applyStyle(){ captionStyle.transFontFamily = currentTransFontFamily.value; captionStyle.transFontSize = currentTransFontSize.value; captionStyle.transFontColor = currentTransFontColor.value; + captionStyle.transFontWeight = currentTransFontWeight.value; + captionStyle.textShadow = currentTextShadow.value; + captionStyle.offsetX = currentOffsetX.value; + captionStyle.offsetY = currentOffsetY.value; + captionStyle.blur = currentBlur.value; + captionStyle.textShadowColor = currentTextShadowColor.value; captionStyle.sendStylesChange(); @@ -206,6 +292,7 @@ function backStyle(){ currentFontFamily.value = captionStyle.fontFamily; currentFontSize.value = captionStyle.fontSize; currentFontColor.value = captionStyle.fontColor; + currentFontWeight.value = captionStyle.fontWeight; currentBackground.value = captionStyle.background; currentOpacity.value = captionStyle.opacity; currentPreview.value = captionStyle.showPreview; @@ -213,6 +300,12 @@ function backStyle(){ currentTransFontFamily.value = captionStyle.transFontFamily; currentTransFontSize.value = captionStyle.transFontSize; currentTransFontColor.value = captionStyle.transFontColor; + currentTransFontWeight.value = captionStyle.transFontWeight; + currentTextShadow.value = captionStyle.textShadow; + currentOffsetX.value = captionStyle.offsetX; + currentOffsetY.value = captionStyle.offsetY; + currentBlur.value = captionStyle.blur; + currentTextShadowColor.value = captionStyle.textShadowColor; } function resetStyle() { @@ -229,6 +322,16 @@ watch(changeSignal, (val) => {