trying stereo audio!

This commit is contained in:
legop3
2026-06-26 13:47:23 -04:00
parent c2224d00e3
commit 274fe279d8
5 changed files with 44 additions and 51 deletions
-15
View File
@@ -59,9 +59,6 @@ type AudioConfig struct {
CaptureEnabled bool `yaml:"captureEnabled" json:"captureEnabled"`
CaptureDevice string `yaml:"captureDevice" json:"captureDevice,omitempty"`
PlaybackDevice string `yaml:"playbackDevice" json:"playbackDevice,omitempty"`
SampleRate int `yaml:"sampleRate" json:"sampleRate,omitempty"`
Channels int `yaml:"channels" json:"channels,omitempty"`
Bitrate int `yaml:"bitrate" json:"bitrate,omitempty"`
TTSEnabled bool `yaml:"ttsEnabled" json:"ttsEnabled"`
DefaultEngine string `yaml:"defaultEngine" json:"defaultEngine,omitempty"`
DefaultVoice string `yaml:"defaultVoice" json:"defaultVoice,omitempty"`
@@ -199,9 +196,6 @@ func LoadConfig(path string) (*Config, error) {
CaptureEnabled: false,
CaptureDevice: "rovermic",
PlaybackDevice: "forward",
SampleRate: 48000,
Channels: 2,
Bitrate: 24000,
TTSEnabled: false,
DefaultEngine: "flite",
DefaultVoice: "rms",
@@ -364,15 +358,6 @@ func validateAudioConfig(cfg *AudioConfig) {
if cfg.PlaybackDevice == "" || cfg.PlaybackDevice == "default" {
cfg.PlaybackDevice = "forward"
}
if cfg.SampleRate <= 0 {
cfg.SampleRate = 48000
}
if cfg.Channels <= 0 {
cfg.Channels = 2
}
if cfg.Bitrate <= 0 {
cfg.Bitrate = 64000
}
if cfg.DefaultEngine == "" {
cfg.DefaultEngine = "flite"
}
-8
View File
@@ -45,12 +45,6 @@ func UpdatePublisherEnv(media MediaConfig, audio AudioConfig) error {
if audioDevice == "" || audioDevice == "rovermic" {
audioDevice = "hw:0,0"
}
if audio.SampleRate <= 0 {
audio.SampleRate = 48000
}
if audio.Channels <= 0 {
audio.Channels = 2
}
fmt.Fprintf(&buf, "AUDIO_ENABLE=%d\n", boolToInt(audio.CaptureEnabled))
fmt.Fprintf(&buf, "AUDIO_DEVICE=%s\n", audioDevice)
playbackDevice := audio.PlaybackDevice
@@ -58,8 +52,6 @@ func UpdatePublisherEnv(media MediaConfig, audio AudioConfig) error {
playbackDevice = "forward"
}
fmt.Fprintf(&buf, "AUDIO_PLAYBACK_DEVICE=%s\n", playbackDevice)
fmt.Fprintf(&buf, "AUDIO_RATE=%d\n", audio.SampleRate)
fmt.Fprintf(&buf, "AUDIO_CHANNELS=%d\n", audio.Channels)
if err := os.WriteFile(publisherEnvPath, buf.Bytes(), 0o640); err != nil {
return err
}
-3
View File
@@ -44,9 +44,6 @@ audio:
captureEnabled: false
captureDevice: hw:0,0
playbackDevice: forward
sampleRate: 48000
channels: 2
bitrate: 24000
ttsEnabled: false
defaultEngine: flite
defaultVoice: rms