Fix: respect external USB-C microphone input during voice message recording#2029
Open
hanxiao wants to merge 1 commit intoTelegramMessenger:masterfrom
Open
Fix: respect external USB-C microphone input during voice message recording#2029hanxiao wants to merge 1 commit intoTelegramMessenger:masterfrom
hanxiao wants to merge 1 commit intoTelegramMessenger:masterfrom
Conversation
overrideOutputAudioPort(.speaker) forces both output and input to built-in devices, ignoring external USB-C microphones (e.g. wireless mic receivers) that the user selected in iOS Settings. After the override, check availableInputs for non-built-in, non-bluetooth, non-headphone input devices and restore them as preferred input. This preserves existing behavior when no external device is connected. Fixes: voice messages ignore USB-C microphone on iOS 26+
scutuatua-crypto
approved these changes
Feb 25, 2026
d385e98 to
fa00c05
Compare
|
PR #2029发自我的 iPhone在 佛历2569年2月26日,17:40,CLAassistant ***@***.***> 写道:CLAassistant left a comment (TelegramMessenger/Telegram-iOS#2029)
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
|
PR #2029
志�� ***@***.***>于佛历2569年2月27日 周五07:46写道:
… PR #2029
发自我的 iPhone
在 佛历2569年2月26日,17:40,CLAassistant ***@***.***> 写道:
*CLAassistant* left a comment (TelegramMessenger/Telegram-iOS#2029)
<#2029 (comment)>
[image: CLA assistant check]
<https://cla-assistant.io/TelegramMessenger/Telegram-iOS?pullRequest=2029>
Thank you for your submission! We really appreciate it. Like many open
source projects, we ask that you sign our Contributor License Agreement
<https://cla-assistant.io/TelegramMessenger/Telegram-iOS?pullRequest=2029>
before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us
recheck
<https://cla-assistant.io/check/TelegramMessenger/Telegram-iOS?pullRequest=2029>
it.
—
Reply to this email directly, view it on GitHub
<#2029 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BPF3C3LG563QGVWDPHYRS6D4N3EQLAVCNFSM6AAAAACV4IC7VOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTSNRVG4ZTKMZSGU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
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.
Problem
When recording voice messages with an external USB-C microphone (e.g. BOYA Mini 2 wireless mic receiver), Telegram ignores the external device and records from the built-in microphone instead.
This happens because
setupOutputModecallsoverrideOutputAudioPort(.speaker)for voice message recording (.record(false, _, _)). Per Apple docs, this forces both output and input to built-in devices, regardless of other settings.Other apps (Voice Memos, Camera) correctly use the external microphone. The user can verify the device is recognized in iOS Settings > Sounds & Haptics > Input.
Related: #1195, bugs.telegram.org/c/58429
Fix
After the speaker override, check
availableInputsfor connected external input devices (excluding built-in mic, Bluetooth, and wired headphones) and restore them as the preferred input viasetPreferredInput.try?so failures don't affect existing flowsDiff