configuration file

This commit is contained in:
LeonardoTrapani
2025-08-18 22:59:22 +02:00
parent bcaf1181a0
commit b8a22662f3
13 changed files with 556 additions and 109 deletions
-13
View File
@@ -28,17 +28,6 @@ type Config struct {
ChannelBufferSize int
}
func DefaultConfig() Config {
return Config{
SampleRate: 16000,
Channels: 1,
Format: "s16",
BufferSize: 8192,
Device: "",
ChannelBufferSize: 30,
}
}
type Recorder struct {
config Config
recording atomic.Bool
@@ -218,8 +207,6 @@ func (r *Recorder) buildPwRecordArgs() []string {
return args
}
func NewDefaultRecorder() *Recorder { return NewRecorder(DefaultConfig()) }
func CheckPipeWireAvailable(ctx context.Context) error {
if _, err := exec.LookPath("pw-record"); err != nil {
return fmt.Errorf("pw-record not found: %w (install pipewire-tools)", err)