Remove RestartTimer() from AvAudioNode Callback#3196
Merged
TheCodeTraveler merged 1 commit intomainfrom Apr 11, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes iOS + MacCatalyst (and macOS equivalents) silence auto-stop behavior for SpeechToText by ensuring the silence timer is not continuously reset by AVAudioEngine tap buffers that are delivered even during silence. This aligns AutoStopSilenceTimeout behavior with the intended “stop after silence” semantics (Fixes #3195).
Changes:
- Removed
RestartTimer()fromAVAudioNode.InstallTapOnBuscallbacks so the silence timer isn’t reset on every incoming (silent) buffer. - Simplified tap callbacks to only append buffers to the recognition request.
- Updated macOS
GetBusOutputFormatusage to match the tapped bus.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.macos.cs | Stop resetting the silence timer from the AVAudioEngine tap; align bus format retrieval with the tap bus. |
| src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.ios.cs | Stop resetting the silence timer from the AVAudioEngine tap to allow AutoStopSilenceTimeout to elapse during silence. |
| src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.macos.cs | Same fix as online implementation for offline recognition on macOS. |
| src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.ios.cs | Same fix as online implementation for offline recognition on iOS/MacCatalyst. |
VladislavAntonyuk
approved these changes
Apr 11, 2026
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.
Description of Change
After confirming that the
AvAudioNodecallback is triggered during silence, this PR removesRestartTimer()from theAvAudioNodecallback on iOS + MacCatalyst when installing a tap on the bus.Linked Issues
PR Checklist
approved(bug) orChampioned(feature/proposal)mainat time of PRAdditional information