Skip to content

feat: add silence detection callbacks for microphone control#89

Open
Jah-yee wants to merge 1 commit intoNVIDIA:mainfrom
Jah-yee:docs/silence-feature
Open

feat: add silence detection callbacks for microphone control#89
Jah-yee wants to merge 1 commit intoNVIDIA:mainfrom
Jah-yee:docs/silence-feature

Conversation

@Jah-yee
Copy link
Copy Markdown

@Jah-yee Jah-yee commented Apr 14, 2026

Good day,

Thank you for working on this project. I saw issue #85 about detecting when the model is about to talk to mute the microphone, and I wanted to help implement a solution.

This PR adds optional on_silence_start and on_speech_start callback parameters to the LMGen class that can be used to detect when the model starts producing silence vs speech, enabling external microphone muting.

Usage

gen = LMGen(
    model,
    on_silence_start=lambda: print("Silence started"),
    on_speech_start=lambda: print("Speech started"),
)

These callbacks fire at the beginning and end of audio silence periods respectively, allowing external systems to know when it's safe to mute the microphone.

Thank you for your work on this project. I hope this small fix is helpful. Please let me know if there's anything to adjust.

Warmly, RoomWithOutRoof

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.

1 participant