Conversation
- Add --volume flag to adjust TTS audio output level (default: 1.0) - Implement pcm.AdjustVolume() to multiply F32LE PCM samples - Apply volume adjustment in synthesize pipeline after TTS generation - Works on all platforms (macOS, Linux, Windows) by operating on PCM data - Clamps output to [-1.0, 1.0] to prevent clipping distortion - Add comprehensive tests for volume adjustment function - Update example config.yaml with volume configuration option
- Replace bufio.Scanner with new internal/parser/token.Stream for clean backtracking - Eliminate messy prependToScanner and parseBearing 'extra' string hacks - Token stream supports position save/restore and partial token consumption - Simplify declare parsing logic - skip filler words, try BRAA/bullseye cleanly - All 808 tests pass, including all parser unit tests - Public API unchanged (Parser.New and Parser.Parse signatures identical) Benefits: - Clean backtracking via SavePosition/RestorePosition - No more scanner reconstruction for prepending text - Handles partial tokens (e.g. '13015' -> bearing 130, range 15) - More maintainable and easier to understand parsing flow
- Extract magic numbers into named constants (similarityThreshold, halfFieldMinLength, maxCallsignDigits, maxInputLength) - Break down Parse() method by extracting handleNoRequestWord and parseRequestWithArgs helpers - Consolidate normalization pipeline to reduce string allocations and passes - Add early input validation for empty and excessively long inputs - Reduce code duplication with parseBearingOnly helper for SPIKED/STROBE requests - Remove redundant test functions for internal helpers now consolidated in normalize() - Add strings.Builder.WriteRune to golangci-lint exclusions (always returns nil error per docs) No public API changes - all improvements are internal refactoring.
…d simplifying variable names - Remove ~20 inline comments that restate what code already shows - Simplify variable names following Go conventions (use 'ok' for booleans) - Use shorter names in tight scopes (n, idx, consumed, rng) - Rename clanTagExpression -> clanTagRe for consistency - Keep all GoDocs and debug logs intact - Keep useful comments explaining business logic Reduces visual noise while maintaining comprehension through Go idioms.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pull main into UTM branch