diff --git a/engine/audio2text/sosv.py b/engine/audio2text/sosv.py index 28e38e3..666b0b1 100644 --- a/engine/audio2text/sosv.py +++ b/engine/audio2text/sosv.py @@ -63,7 +63,7 @@ class SosvRecognizer: vad_config.silero_vad.threshold = 0.5 vad_config.silero_vad.min_silence_duration = 0.1 vad_config.silero_vad.min_speech_duration = 0.25 - vad_config.silero_vad.max_speech_duration = 8 + vad_config.silero_vad.max_speech_duration = 5 vad_config.sample_rate = 16000 self.window_size = vad_config.silero_vad.window_size self.vad = sherpa_onnx.VoiceActivityDetector(vad_config, buffer_size_in_seconds=100) diff --git a/engine/main.py b/engine/main.py index a99ca44..fba4845 100644 --- a/engine/main.py +++ b/engine/main.py @@ -17,8 +17,11 @@ def audio_recording(stream: AudioStream, resample: bool, record = False, path = wf = None full_name = '' if record: - if path != '' and path[-1] != '/': - path += '/' + if path != '': + if path.startswith('"') and path.endswith('"'): + path = path[1:-1] + if path[-1] != '/': + path += '/' cur_dt = datetime.datetime.now() name = cur_dt.strftime("audio-%Y-%m-%dT%H-%M-%S") full_name = f'{path}{name}.wav' diff --git a/src/main/types/index.ts b/src/main/types/index.ts index d80f142..4fe5db2 100644 --- a/src/main/types/index.ts +++ b/src/main/types/index.ts @@ -23,6 +23,7 @@ export interface Controls { } export interface Styles { + lineNumber: number, lineBreak: number, fontFamily: string, fontSize: number, diff --git a/src/main/utils/AllConfig.ts b/src/main/utils/AllConfig.ts index 9e6109a..5a7ea8c 100644 --- a/src/main/utils/AllConfig.ts +++ b/src/main/utils/AllConfig.ts @@ -19,6 +19,7 @@ function getDesktopPath() { } const defaultStyles: Styles = { + lineNumber: 1, lineBreak: 1, fontFamily: 'sans-serif', fontSize: 24, diff --git a/src/main/utils/CaptionEngine.ts b/src/main/utils/CaptionEngine.ts index 1b876ff..c87e383 100644 --- a/src/main/utils/CaptionEngine.ts +++ b/src/main/utils/CaptionEngine.ts @@ -66,7 +66,7 @@ export class CaptionEngine { this.command.push('-a', allConfig.controls.audio ? '1' : '0') if(allConfig.controls.recording) { this.command.push('-r', '1') - this.command.push('-rp', allConfig.controls.recordingPath) + this.command.push('-rp', `"${allConfig.controls.recordingPath}"`) } this.port = Math.floor(Math.random() * (65535 - 1024 + 1)) + 1024 this.command.push('-p', this.port.toString()) diff --git a/src/renderer/src/components/CaptionStyle.vue b/src/renderer/src/components/CaptionStyle.vue index c3498c7..4a2211d 100644 --- a/src/renderer/src/components/CaptionStyle.vue +++ b/src/renderer/src/components/CaptionStyle.vue @@ -6,6 +6,16 @@ {{ $t('style.resetStyle') }} +
- {{ captionData[captionData.length-1].text }} - {{ $t('example.original') }} -
-- {{ captionData[captionData.length-1].translation }} - {{ $t('example.translation') }} -
+ + ++ {{ captionData[captionData.length - val].text }} +
++ {{ captionData[captionData.length - val].translation }} +
+ + + + ++ {{ $t('example.original') }} +
++ {{ $t('example.translation') }} +
+ +- {{ captionData[captionData.length-1].text }} - {{ $t('example.original') }} -
-- {{ captionData[captionData.length-1].translation }} - {{ $t('example.translation') }} -
+ + ++ {{ captionData[captionData.length - val].text }} +
++ {{ captionData[captionData.length - val].translation }} +
+ + + + ++ {{ $t('example.original') }} +
++ {{ $t('example.translation') }} +
+ +