summaryrefslogtreecommitdiff
path: root/extra/whisper_binary.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2025-11-09 11:28:50 +0300
committerGrail Finder <wohilas@gmail.com>2025-11-09 11:28:50 +0300
commit4a581f6c122255bddcb3580539ff24b3c7d7c657 (patch)
tree0c2a11fee18a9f2b241709ffbb80ecad643b2c4b /extra/whisper_binary.go
parent8036bf0081df1fe81ef8af4d1714c173680a1980 (diff)
Chore: stt reworks [WIP]
Diffstat (limited to 'extra/whisper_binary.go')
-rw-r--r--extra/whisper_binary.go31
1 files changed, 31 insertions, 0 deletions
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,
+ }
+}