Repository navigation
Add an RMS line-sense option to the source client example - #201
Merged
Merged
Conversation
Signal detection belongs to the application; the integration guide now says so, and source_client's -s DBFS reports line sense from the input's RMS level (100 ms to turn present, 2 s to turn absent).
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The untested metering state machine and inaccurate timing documentation should be addressed before approval.
5 open findings
What changed in this PR
Adds optional RMS-based line sensing to the source client example.
Changes:
- Adds
-s DBFSwith 100 ms present and 2 s absent holds. - Keeps capture active for metering while gating audio forwarding.
- Documents application-managed line sensing.
| File | Description |
|---|---|
examples/source_client/README.md |
Documents line-sense usage. |
examples/source_client/main.cpp |
Implements RMS metering, holds, and signal reporting. |
docs/integration-guide.md |
Clarifies line-sense responsibilities. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.


Addresses #133.
The spec has the server alone start a source stream (roles/source/v1.md "Default streaming behavior"); a client reports line sense as a hint. The library already supports that through
SourceRoleConfig::line_senseandSourceRole::set_signal(), and detection stays in the application.docs/integration-guide.md: says detection is the application's job and to callset_signal()on each change.examples/source_client:-s DBFSmeters each buffer's RMS level and reports present after 100 ms at or above the threshold, absent after 2 s below. Capture runs from startup in that mode; audio reacheswrite_audio()only while the stream is open. Without-sthe example is unchanged.Testing: built and run on macOS;
-s -70on the laptop mic reported absent then present, and an invalid threshold is rejected. No unit tests (example code).