mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-17 10:00:46 -04:00
trying a new method
This commit is contained in:
+1
-1
@@ -143,7 +143,7 @@ func LoadConfig(path string) (*Config, error) {
|
||||
Audio: AudioConfig{
|
||||
CaptureEnabled: false,
|
||||
CaptureDevice: "plughw:0,0",
|
||||
SampleRate: 48000,
|
||||
SampleRate: 16000,
|
||||
Channels: 1,
|
||||
Bitrate: 24000,
|
||||
TTSEnabled: false,
|
||||
|
||||
+14
-2
@@ -25,8 +25,20 @@ func UpdatePublisherEnv(media MediaConfig, audio AudioConfig) error {
|
||||
fmt.Fprintf(&buf, "VIDEO_HEIGHT=%d\n", media.VideoHeight)
|
||||
fmt.Fprintf(&buf, "VIDEO_FPS=%d\n", media.VideoFPS)
|
||||
fmt.Fprintf(&buf, "VIDEO_BITRATE=%d\n", media.VideoBitrate)
|
||||
// Disable mic streaming; audio is handled locally for TTS only.
|
||||
fmt.Fprintf(&buf, "AUDIO_ENABLE=0\n")
|
||||
audioDevice := audio.CaptureDevice
|
||||
if audioDevice == "" {
|
||||
audioDevice = "plughw:0,0"
|
||||
}
|
||||
if audio.SampleRate <= 0 {
|
||||
audio.SampleRate = 16000
|
||||
}
|
||||
if audio.Channels <= 0 {
|
||||
audio.Channels = 1
|
||||
}
|
||||
fmt.Fprintf(&buf, "AUDIO_ENABLE=%d\n", boolToInt(audio.CaptureEnabled))
|
||||
fmt.Fprintf(&buf, "AUDIO_DEVICE=%s\n", audioDevice)
|
||||
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
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ cameraServo:
|
||||
audio:
|
||||
captureEnabled: false
|
||||
captureDevice: plughw:0,0
|
||||
sampleRate: 48000
|
||||
sampleRate: 16000
|
||||
channels: 1
|
||||
bitrate: 24000
|
||||
ttsEnabled: false
|
||||
|
||||
Reference in New Issue
Block a user