From 4a581f6c122255bddcb3580539ff24b3c7d7c657 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sun, 9 Nov 2025 11:28:50 +0300 Subject: Chore: stt reworks [WIP] --- extra/whisper_binary.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 extra/whisper_binary.go (limited to 'extra/whisper_binary.go') diff --git a/extra/whisper_binary.go b/extra/whisper_binary.go new file mode 100644 index 0000000..1002a97 --- /dev/null +++ b/extra/whisper_binary.go @@ -0,0 +1,31 @@ +package extra + +import ( + "context" + "gf-lt/config" + "log/slog" + "os/exec" + "sync" +) + +type WhisperBinary struct { + whisperPath string + modelPath string + lang string + ctx context.Context + cancel context.CancelFunc + mu sync.Mutex + running bool + cmd *exec.Cmd +} + +func NewWhisperBinary(logger *slog.Logger, cfg *config.Config) *WhisperBinary { + ctx, cancel := context.WithCancel(context.Background()) + return &WhisperBinary{ + whisperPath: cfg.WhisperBinaryPath, + modelPath: cfg.WhisperModelPath, + lang: cfg.STT_LANG, + ctx: ctx, + cancel: cancel, + } +} -- cgit v1.2.3