Repository navigation
feat: expose optional audio visualization snapshots - #267
Conversation
|
All Contributors have signed the CLA. The PR is now allowed to be merged. |
|
recheck |
1Lucas1apk
left a comment
There was a problem hiding this comment.
The observer implementation and its synthetic coverage look focused, and the PR keeps the feature opt-in. I found one concrete integration gap in the configuration path: visualization is added to the public config type and read by the runtime, but the central ConfigValidationManager schema still only declares playback.audio.processingMode. Please add explicit boolean validation for the new option. I could not run the full NodeLink type-check/build locally because this runtime cannot resolve GitHub to obtain a checkout; the fork's CI claims are not independent verification, and no status run for this exact HEAD was returned by the GitHub status endpoint.
| /** Audio processing path; defaults to the unchanged legacy pipeline. */ | ||
| processingMode?: AudioProcessingMode | ||
| /** Optional bounded PCM visualization snapshots. */ | ||
| visualization?: boolean |
There was a problem hiding this comment.
This new visualization setting is consumed by streamProcessor.ts, but ConfigValidationManager still has no playback.audio.visualization schema entry. A non-boolean value can therefore pass central config validation and then silently disable the observer because the runtime checks === true. Please add it as an optional boolean to the central audio schema.
1Lucas1apk
left a comment
There was a problem hiding this comment.
I rechecked the submitted source at c6e991c. The configuration gap from my earlier review is now fixed: playback.audio.visualization is declared as an optional boolean in ConfigValidationManager, matching the public type and runtime gate. The observer also has regression coverage for chunk boundaries, retained peaks and byte-for-byte PCM pass-through. I am not repeating the schema request.
I have not independently run NodeLink's type-check, build or tests in this environment. The CI result in the description refers to 4693b4a, not this final SHA, and the status/workflow endpoints returned no run for c6e991c. This is a code-level acknowledgement, not an approval; please ensure the checks are run against the exact current commit.
1Lucas1apk
left a comment
There was a problem hiding this comment.
I reviewed the current diff against the repository's explicit contribution constraints. The implementation itself is not the reason for this request: the PR adds committed test files (and, in #270, a dedicated regression workflow) despite NodeLink having no authorized test structure or test infrastructure. Please remove the listed files from the PR rather than relocating them into a new test directory or adding a runner. I have not changed your branch or created commits. Build, type-check and runtime validation were not independently executed here; this review is limited to the clear repository-structure requirement.
| @@ -0,0 +1,80 @@ | |||
| import assert from 'node:assert/strict' | |||
There was a problem hiding this comment.
Please remove this newly added test file. NodeLink has no authorized test structure, so a *.test.ts file inside the production source tree cannot be introduced. Do not replace it with another committed runner or test directory.
|
Thanks for the review. Removed the added visualization test file; the central configuration validation and observer implementation remain unchanged. Fork CI on |
1Lucas1apk
left a comment
There was a problem hiding this comment.
I checked the exact current diff at e84a0a3: AudioVisualization.test.ts is gone and the production change remains opt-in. The observer uses fixed-size PCM buffers, emits the original chunk unchanged, and only returns a recent snapshot. The reported Node/Bun checks are contributor-fork CI; the connected status/workflow lookup did not return a run for this SHA, and I could not independently build or exercise Discord output. No approval is implied.
TheFrogEcliptia
left a comment
There was a problem hiding this comment.
I reviewed the current diff at e84a0a3. The visualization observer is opt-in, operates on the processed PCM path, retains only bounded snapshots and passes each input chunk through unchanged. The central configuration schema now validates the public option, and the added output fields are appropriately optional. I found no blocking issue in the reviewed diff. Contributor-reported fork CI covers type-check, build and the Node/Bun checks; live Discord client behavior was not independently exercised here. Approved.
Changes
Add an opt-in PCM observer before Opus encoding, after output processing.
Expose stereo RMS and sample peaks, a 32-bin amplitude envelope, eight frequency-probe magnitudes and an output frame counter through player JSON.
Bound retained audio samples and snapshot lifetime; leave the feature disabled by default.
Compute RMS, peaks and envelope over the complete reporting interval, retaining a bounded spectral window.
Validate
playback.audio.visualizationas an optional boolean in the central configuration schema.Why
Clients can build audio-reactive interfaces from compact numerical data without opening a second audio stream or receiving raw PCM.
Checkmarks
Additional information
Updated against upstream
devat86c6a00. The README is unchanged from upstream. Formatting, type-check, build and regression tests passed on the earlier commit4693b4a(fork CI job).The five Node HTTP adapter tests run on Node, not Bun. A separate native Bun server suite runs in Bun. These are fork CI results, not independent maintainer validation.
The current HEAD
e84a0a3removes only the review-requested test files; production code and generated output are unchanged from its parent. No new test files or workflow remain in the PR.Exact-HEAD fork validation passed on
e84a0a3: type-check, build, generated-output verification and clean-checkout verification. Node.js 22 and 24 each passed 31 tests (0 failures, 3 skipped); Bun passed 29 tests (0 failures). Regression harnesses were restored only into a temporary directory outside the checkout, not into the submission. The earlier results above remain historical. These are contributor-fork checks, not independent maintainer validation.Validation limitations: The frame counter represents processed output rather than the audible media timestamp. Synthetic PCM tests and benchmarks do not establish real Discord output timing, production load or end-to-end Lavalink compatibility.