Skip to content

UTM#15

Merged
red-one1 merged 8 commits intoUTMfrom
main
Dec 8, 2025
Merged

UTM#15
red-one1 merged 8 commits intoUTMfrom
main

Conversation

@red-one1
Copy link
Owner

@red-one1 red-one1 commented Dec 8, 2025

pull main into UTM branch

- 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.
@red-one1 red-one1 merged commit ddae1e5 into UTM Dec 8, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants