mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-19 05:16:27 -07:00
feat(subtitles): add local Japanese subtitle generation (#240)
This commit is contained in:
@@ -1,10 +1,46 @@
|
||||
import { ResolvedConfig } from '../../types/config';
|
||||
import { ConfigOptionRegistryEntry } from './shared';
|
||||
import { SUBTITLE_GENERATION_MODELS } from '../../shared/subtitle-generation-model-catalog';
|
||||
|
||||
export function buildSubtitleConfigOptionRegistry(
|
||||
defaultConfig: ResolvedConfig,
|
||||
): ConfigOptionRegistryEntry[] {
|
||||
return [
|
||||
...(
|
||||
['whisperPath', 'modelPath', 'ffmpegPath', 'ffprobePath', 'vadModelPath', 'vadPath'] as const
|
||||
).map((key) => ({
|
||||
path: `subtitleGeneration.${key}`,
|
||||
kind: 'string' as const,
|
||||
defaultValue: defaultConfig.subtitleGeneration[key],
|
||||
description: {
|
||||
whisperPath:
|
||||
'Optional path override for whisper.cpp. Leave empty to find whisper-cli on PATH.',
|
||||
modelPath:
|
||||
'Path to an existing multilingual whisper.cpp GGML model. Leave empty to use a SubMiner-managed model. A configured path always takes precedence.',
|
||||
ffmpegPath:
|
||||
'Optional FFmpeg path override for audio extraction. Leave empty to find ffmpeg on PATH.',
|
||||
ffprobePath:
|
||||
'Optional FFprobe path override for audio tracks and timing. Leave empty to find ffprobe on PATH.',
|
||||
vadModelPath:
|
||||
'Path to a whisper.cpp Silero VAD model. Enables dialogue-focused generation while retaining uncertain audible sections, which may include songs. Leave empty to transcribe the full audio.',
|
||||
vadPath:
|
||||
'Optional speech detector executable override. With vadModelPath configured, leave empty to find whisper-vad-speech-segments or vad-speech-segments on PATH.',
|
||||
}[key],
|
||||
})),
|
||||
{
|
||||
path: 'subtitleGeneration.managedModel',
|
||||
kind: 'enum',
|
||||
enumValues: SUBTITLE_GENERATION_MODELS.map((model) => model.id),
|
||||
defaultValue: defaultConfig.subtitleGeneration.managedModel,
|
||||
description:
|
||||
'Multilingual whisper.cpp model to use when modelPath is empty. Download it explicitly from the generation modal or launcher.',
|
||||
},
|
||||
{
|
||||
path: 'subtitleGeneration.threads',
|
||||
kind: 'number',
|
||||
defaultValue: defaultConfig.subtitleGeneration.threads,
|
||||
description: 'Positive integer CPU thread count for whisper.cpp Japanese transcription.',
|
||||
},
|
||||
{
|
||||
path: 'subtitleStyle.primaryDefaultMode',
|
||||
kind: 'enum',
|
||||
|
||||
Reference in New Issue
Block a user