refactor: implement cross-platform abstraction for process management, media control, and startup configuration (TESTING)

This commit is contained in:
jahruz67
2026-04-09 21:31:02 -07:00
parent cc644e3059
commit ba0e75c503
25 changed files with 458 additions and 48 deletions
@@ -0,0 +1,9 @@
//go:build !windows
package whisper
import "os/exec"
func hideWindowContext(cmd *exec.Cmd) {
// Not needed on non-Windows platforms
}
+15
View File
@@ -0,0 +1,15 @@
//go:build windows
package whisper
import (
"os/exec"
"syscall"
)
func hideWindowContext(cmd *exec.Cmd) {
cmd.SysProcAttr = &syscall.SysProcAttr{
HideWindow: true,
CreationFlags: 0x08000000, // CREATE_NO_WINDOW
}
}
+2 -6
View File
@@ -10,7 +10,6 @@ import (
"os/exec"
"path/filepath"
"strings"
"syscall"
"time"
"wis-free-v3/internal/logger"
@@ -285,11 +284,8 @@ func (m *Manager) Transcribe(audioPath string) (string, error) {
// Set working directory to the binary's location so it can find DLLs
cmd.Dir = filepath.Dir(binaryPath)
// Hide the console window
cmd.SysProcAttr = &syscall.SysProcAttr{
HideWindow: true,
CreationFlags: 0x08000000, // CREATE_NO_WINDOW
}
// Hide the console window on Windows
hideWindowContext(cmd)
output, err := cmd.CombinedOutput()
outputStr := string(output)