diff --git a/engine/utils/audioprcs.py b/engine/utils/audioprcs.py index a4362a2..e083c5e 100644 --- a/engine/utils/audioprcs.py +++ b/engine/utils/audioprcs.py @@ -39,15 +39,15 @@ def resample_chunk_mono(chunk: bytes, channels: int, orig_sr: int, target_sr: in 单通道音频数据块 """ if channels == 1: - chunk_mono = chunk + chunk_mono = np.frombuffer(chunk, dtype=np.int16) + chunk_mono = chunk_mono.astype(np.float32) else: # (length * channels,) chunk_np = np.frombuffer(chunk, dtype=np.int16) # (length, channels) chunk_np = chunk_np.reshape(-1, channels) # (length,) - chunk_mono_f = np.mean(chunk_np.astype(np.float32), axis=1) - chunk_mono = chunk_mono_f.astype(np.int16) + chunk_mono = np.mean(chunk_np.astype(np.float32), axis=1) ratio = target_sr / orig_sr chunk_mono_r = samplerate.resample(chunk_mono, ratio, converter_type=mode) @@ -69,6 +69,7 @@ def resample_mono_chunk(chunk: bytes, orig_sr: int, target_sr: int, mode="sinc_b 单通道音频数据块 """ chunk_np = np.frombuffer(chunk, dtype=np.int16) + chunk_np = chunk_np.astype(np.float32) ratio = target_sr / orig_sr chunk_r = samplerate.resample(chunk_np, ratio, converter_type=mode) chunk_r = np.round(chunk_r).astype(np.int16) diff --git a/src/main/utils/CaptionEngine.ts b/src/main/utils/CaptionEngine.ts index 93cd503..3d164e1 100644 --- a/src/main/utils/CaptionEngine.ts +++ b/src/main/utils/CaptionEngine.ts @@ -54,7 +54,12 @@ export class CaptionEngine { } } else { - this.appPath = path.join(process.resourcesPath, 'engine', 'main.exe') + if(process.platform === 'win32') { + this.appPath = path.join(process.resourcesPath, 'engine', 'main.exe') + } + else { + this.appPath = path.join(process.resourcesPath, 'engine', 'main') + } } this.command.push('-a', allConfig.controls.audio ? '1' : '0') diff --git a/src/renderer/src/i18n/lang/en.ts b/src/renderer/src/i18n/lang/en.ts index 24376af..30136f6 100644 --- a/src/renderer/src/i18n/lang/en.ts +++ b/src/renderer/src/i18n/lang/en.ts @@ -119,7 +119,7 @@ export default { "projLink": "Project Link", "manual": "User Manual", "engineDoc": "Caption Engine Manual", - "date": "July 29, 2025" + "date": "July 30, 2025" } }, log: { diff --git a/src/renderer/src/i18n/lang/ja.ts b/src/renderer/src/i18n/lang/ja.ts index 0f91142..9dcde86 100644 --- a/src/renderer/src/i18n/lang/ja.ts +++ b/src/renderer/src/i18n/lang/ja.ts @@ -119,7 +119,7 @@ export default { "projLink": "プロジェクトリンク", "manual": "ユーザーマニュアル", "engineDoc": "字幕エンジンマニュアル", - "date": "2025 年 7 月 29 日" + "date": "2025 年 7 月 30 日" } }, log: { diff --git a/src/renderer/src/i18n/lang/zh.ts b/src/renderer/src/i18n/lang/zh.ts index ddb52b5..46edb1d 100644 --- a/src/renderer/src/i18n/lang/zh.ts +++ b/src/renderer/src/i18n/lang/zh.ts @@ -119,7 +119,7 @@ export default { "projLink": "项目链接", "manual": "用户手册", "engineDoc": "字幕引擎手册", - "date": "2025 年 7 月 29 日" + "date": "2025 年 7 月 30 日" } }, log: {