feat: full WSL2 audio support and Windows audio stability fix
This commit is contained in:
23
cmd/tui/noise_linux.go
Normal file
23
cmd/tui/noise_linux.go
Normal file
@@ -0,0 +1,23 @@
|
||||
//go:build linux
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func redirectStderr(f *os.File) {
|
||||
if f == nil {
|
||||
// Silence altogether if no debug file
|
||||
null, err := os.OpenFile(os.DevNull, os.O_WRONLY, 0)
|
||||
if err == nil {
|
||||
syscall.Dup2(int(null.Fd()), int(os.Stderr.Fd()))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Redirect fd 2 (stderr) to our debug file
|
||||
// This captures C-level library noise (ALSA, PortAudio) into the log
|
||||
syscall.Dup2(int(f.Fd()), int(os.Stderr.Fd()))
|
||||
}
|
||||
Reference in New Issue
Block a user