Commit Graph
38 Commits
Author SHA1 Message Date
Tyler SpiveyandClaude Opus 5 4393739ffa Add F12 hotkey to toggle microphone AGC
Automatic gain control was always on with no way to turn it off. Toggle
it with F12, the /agc command, or the agc FIFO command, and persist the
choice in the configuration file the same way noise suppression does.

AgcEnabled defaults to true so existing setups keep their current
behavior, and the saved value is applied to the stream on connect. The
enabled flag becomes an atomic.Bool because the capture goroutine reads
it while the UI goroutine writes it, and the lazily created right
channel AGC now inherits the left channel's state.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 13:16:44 -07:00
Brandon McGinty (chatgpt) e9ba7f580a Synchronize connection-owned stream access 2026-08-10 11:25:08 -04:00
Brandon McGinty (chatgpt) 57961ffc9f Synchronize connection-owned audio resources 2026-08-10 10:28:01 -04:00
Brandon McGinty (chatgpt) 1d6ab79ed0 Cancel reconnect retries during shutdown 2026-08-10 10:24:38 -04:00
Brandon McGinty (chatgpt) 7785f0a5b5 Synchronize audio encoder selection 2026-08-10 05:03:45 -04:00
Brandon McGinty (chatgpt) 55772fa459 Synchronize connection and transmission state 2026-08-10 00:45:22 -04:00
Brandon McGinty (chatgpt) 3efbd019ce Synchronize selected user access 2026-08-10 00:42:09 -04:00
Brandon McGinty (chatgpt) 20c6997ab0 Synchronize muted channel state 2026-08-10 00:31:29 -04:00
Brandon McGinty (chatgpt) 874cbb7818 Classify recursive channel messages as public 2026-08-10 00:00:40 -04:00
Brandon McGinty (chatgpt) 8348a7083d Fix auto transmit and server messages 2026-08-09 23:28:50 -04:00
Brandon McGinty (chatgpt) bad4e8172a Detach tone-test savers on reconnect 2026-08-09 23:12:56 -04:00
Brandon McGinty (chatgpt) 1ea71b1862 Require talk key for tone test transmission 2026-08-09 22:31:37 -04:00
Brandon McGinty (chatgpt) 612db896ce Show active transmission in tone test mode 2026-08-09 22:28:52 -04:00
Brandon McGinty (chatgpt) d50c6726ad Route network UI callbacks through UI queue 2026-08-09 19:47:14 -04:00
Brandon McGinty (chatgpt) 0766178277 Snapshot connected users under client lock 2026-08-09 18:31:03 -04:00
Brandon McGinty (chatgpt) d07d7342da Release audio resources before reconnecting 2026-08-09 14:50:01 -04:00
Brandon McGinty (chatgpt) e564bb8583 Open tone-test output before transmission 2026-08-09 14:41:01 -04:00
Brandon McGinty (chatgpt) 4497d41077 Persist microphone mute and volume settings 2026-08-09 14:37:06 -04:00
Brandon McGinty (chatgpt) 8c0887d562 Serialize OpenAL playback on a dedicated thread 2026-08-09 12:55:55 -04:00
Brandon McGinty (deepseek) 63941f7785 Fix double tone-generator start in tone-test mode
connect() starts the tone generator but didn't set b.Tx=true,
so setTransmit would start a second instance. Now b.Tx is set
so the UI toggle works as a stop/restart instead of double-start.
2026-08-09 01:02:53 -04:00
Brandon McGinty (deepseek) 29be821155 Add --tone-test mode: 440 Hz Opus tone + incoming audio capture
Adds a --tone-test flag that bypasses all OpenAL/soundcard
initialization and instead:

- Generates a 440 Hz sine wave at 48kHz mono, encodes it via Opus,
  and sends it to the Mumble server.

- Saves all incoming decoded audio to a raw PCM file (s16le,
  stereo, 48kHz) specified by --tone-out (default: incoming.pcm).

Useful for end-to-end testing of the Opus encode/decode pipeline
and Mumble transport without requiring physical audio hardware.

Usage:
  barnard --server HOST --tone-test --tone-out /tmp/in.pcm

  ffplay -f s16le -ar 48000 -ac 2 incoming.pcm
2026-08-09 00:19:41 -04:00
Brandon McGinty (deepseek) b861193306 feat: add -auto-transmit flag to start transmitting on connect
When -auto-transmit is passed, barnard automatically keys up the
microphone as soon as the connection sync completes. Useful for
testing, bots, and unattended operation.

Usage:
  barnard -auto-transmit -server=mumble.example.com -username=test_bot
2026-08-08 22:52:27 -04:00
Brandon McGinty (deepseek) 0858cd3542 fix: add jitter buffer, sequence tracking, and mic error reporting
Add a jitter buffer in OnAudioStream that collects incoming audio packets,
sorts by sequence number, and releases them in order after a small initial
delay (3 packets, ~30ms). This prevents out-of-order playback from network
jitter and reordered UDP packets.

Add a Sequence field to AudioPacket so the jitter buffer can reorder by
sequence number. PLC frames generated by dispatchPLC now also carry the
correct sequence number so they integrate with the jitter buffer.

Add microphone capture error reporting: when CaptureSamples returns fewer
bytes than expected, report the failure to the user via a callback. The
error is reported once when the failure starts and again when the mic
recovers. Wire this up in client.go to display status messages.
2026-08-08 21:02:33 -04:00
Brandon McGinty (deepseek) 9dd0137975 fix: add synchronization to User audio fields to prevent data races
User.AudioSource, Boost, Volume, and LocallyMuted were accessed from
both the OnAudioStream audio goroutine and the UI goroutine without
synchronization, a data race under the Go memory model.

Replace direct field access with thread-safe getter/setter methods
protected by a per-user mutex:
- SetAudioSource/GetAudioSource for the OpenAL source pointer
- SetBoost/Boost for the audio boost multiplier
- SetVolume/Volume for the volume level
- SetLocallyMuted/LocallyMuted for the local mute state

Update all call sites across config/, barnard.go, client.go,
ui_tree.go, and stream.go.
2026-08-08 20:58:53 -04:00
Storm Dragon 9bc514e74f Remove voice effects 2026-07-14 18:41:50 -04:00
Storm Dragon 342f934029 Improve action menu escape handling
Make the F11 action menu close through a shared close action so Escape and the explicit Close actions menu item follow the same path. Treat Escape-prefixed Up and Down events as close inputs while the action menu is active, which handles termbox InputAlt behavior after pressing Escape. Preserve and restore the user/channel tree selection across action menu open and close, and preserve selection across live tree rebuilds.

Tested with: GOCACHE=/tmp/barnard-go-cache go test ./...
2026-06-28 23:57:29 -04:00
Storm Dragon 1f1f72202e Hopefully fixed notification regression. 2026-05-20 18:36:49 -04:00
Storm Dragon cc483685ef Add actions menu admin features 2026-05-19 01:06:01 -04:00
Storm Dragon 69674a0dab Add standards-aware recording 2026-05-14 00:42:30 -04:00
Storm Dragon e3f90a76c0 Fix problem with not being notified of disconnects. 2025-12-12 15:13:37 -05:00
Storm Dragon fae372bb78 Added /file and /stop commands. 2025-11-30 20:31:06 -05:00
Storm DragonandClaude f96cb1f79b Add real-time voice effects for outgoing audio
Implements 7 voice effects that can be cycled through with F12:
- None (default)
- Echo: Single repeating delay with feedback (250ms)
- Reverb: Multiple short delays without feedback
- High Pitch: Chipmunk voice using cubic interpolation
- Low Pitch: Deep voice effect
- Robot: Ring modulation for robotic sound
- Chorus: Layered voices with pitch variations

The effects are applied after noise suppression and AGC in the audio
pipeline. Selected effect is persisted to config file. Includes
comprehensive documentation in README.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-13 16:27:08 -04:00
Storm Dragon df7159bad1 Initial noise suppression added. 2025-08-16 21:29:52 -04:00
Storm Dragon 657ff1dbef Fixed muting so that it should be consistant. meaning, if a muted user leaves and comes back they should still be muted. Channel mute and unmute now specifically sets mute/unmute for each user so the whole channel is in deed muted or unmuted. 2025-07-05 18:25:29 -04:00
Storm Dragon 8c62babd48 Make sure channels are initialized to unmuted when you join. 2025-01-29 00:51:13 -05:00
Storm Dragon c7362dfc36 Now when people join after a channel has been muted the will be muted too. 2025-01-29 00:24:59 -05:00
Storm Dragon 2e337db3c5 Updated everything for dependencies. All sub packages are now part of the project. This was a massive update, hopefully won't have to be reverted. 2025-01-16 17:03:01 -05:00
Storm Dragon 3f0246a4f8 Initial commit, lots of cleanup and stuff to do, it may not work. 2025-01-15 23:43:44 -05:00