js: add Opus dtx for voice WIP#1583
Conversation
Resolve the merge with main and finish the DTX-for-voice work. Main has since landed the usedtx knob and the kind->application/signal plumbing, so the standalone encoder-config.ts extraction is no longer needed: fold all kind-derived Opus settings into opusKindDefaults() inside encoder.ts and add DTX to the voice defaults. Voice now enables discontinuous transmission by default (speech has gaps that DTX collapses to tiny comfort-noise packets); an explicit OpusConfig knob still overrides it. Drops the orphaned encoder-config.ts and moves the tests to encoder.test.ts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The previous commit exported toEncoderConfig so the in-package test could import it, but audio/index.ts re-exports the encoder module with `export *`, which leaked it into @moq/publish's public surface as Audio.toEncoderConfig. Switch that barrel to a named re-export so the published API is unchanged; the symbol stays importable within the package for the test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAn internal 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
js/publish/src/audio/index.ts (1)
1-12: ⚡ Quick winAdd a module-level doc comment with
@module.This file is an entrypoint for the audio module but lacks the required module-level documentation.
📝 Suggested module doc comment
+/** + * Public API surface for the audio encoder module. + * + * Re-exports codec types and the {`@link` Encoder} class. Internal helpers like + * `toEncoderConfig` are intentionally excluded; import them directly from + * `./encoder` for in-package testing only. + * + * `@module` + */ + // toEncoderConfig is intentionally omitted: it's exported from ./encoder only so the in-package test // can import it, not as part of the public API.As per coding guidelines: "Add a module-level doc comment to every entrypoint (a
/** ...@module*/block at the top of each JS entrypoint file)".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@js/publish/src/audio/index.ts` around lines 1 - 12, The audio module entrypoint at index.ts is missing a module-level documentation comment with the `@module` tag as required by the coding guidelines. Add a module-level JSDoc comment (/** `@module` */) at the very top of the file before the existing comment about toEncoderConfig being omitted. This documentation block should describe the purpose of the audio module exports and serve as the entry point documentation for the module.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@js/publish/src/audio/index.ts`:
- Around line 1-12: The audio module entrypoint at index.ts is missing a
module-level documentation comment with the `@module` tag as required by the
coding guidelines. Add a module-level JSDoc comment (/** `@module` */) at the very
top of the file before the existing comment about toEncoderConfig being omitted.
This documentation block should describe the purpose of the audio module exports
and serve as the entry point documentation for the module.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6e398d1c-9944-4362-934e-e1361257192e
📒 Files selected for processing (2)
js/publish/src/audio/encoder.tsjs/publish/src/audio/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- js/publish/src/audio/encoder.ts
The test only restated the opusKindDefaults table, so it added little beyond what the code already says. Removing it lets toEncoderConfig go back to private and restores the plain `export *` barrel, leaving the public API untouched by this change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
addresses #1445 by setting usedtx to true when
kindis voice.Adds 6 tests so far for capture-playback on different kinds and testing silence-frames. I had to move some imports around for testing.
Todos are probably for benching bandwidth on voice calls.