Temporarily mute system playback during voice capture
- Ngôn ngữ chính
- Shell
- Star
- 11.2k
- Fork
- 1.9k
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
### Describe the feature or problem you'd like to solve
Temporarily mute system playback while voice capture is active. For example, I may be listening to Spotify when I press the keyboard shortcut to speak to Copilot. The speaker audio can interfere with microphone capture, so I would like playback muted immediately and restored when I finish talking.
### Proposed solution
Add an option such as **Mute system playback while listening**. When voice capture begins, Copilot should save the current output device and mute state, then mute the active playback device. When capture ends or is cancelled, it should restore the saved state rather than simply toggling mute.
This would improve transcription quality and prevent background audio from being captured without requiring users to manually pause or mute other applications.
### Example prompts or workflows
- While Spotify is playing, press the Copilot voice shortcut; playback is muted until voice capture ends.
- Cancel voice capture; playback immediately returns to its previous state.
- Start voice capture while the output is already muted; it remains muted afterward.
- Switch output devices, including a Bluetooth profile change, while capturing; Copilot safely restores the device state when capture ends.
### Additional context
This appears feasible on all three desktop platforms without elevated privileges:
| Platform | Feasibility | Native mechanism |
| --- | --- | --- |
| Windows | High | Core Audio [`IAudioEndpointVolume`](https://learn.microsoft.com/windows/win32/api/endpointvolume/nn-endpointvolume-iaudioendpointvolume) exposes `GetMute`/`SetMute` for the default render endpoint. |
| macOS | High | Core Audio exposes [`kAudioDevicePropertyMute`](https://developer.apple.com/documentation/coreaudio/kaudiodevicepropertymute), readable and writable through AudioObject property APIs on supported output devices. |
| Linux | Medium-high | PipeWire/WirePlumber supports muting the default sink (for example, [`wpctl set-mute @DEFAULT_AUDIO_SINK@`](https://pipewire.pages.freedesktop.org/wireplumber/tools/wpctl.html)); PulseAudio exposes [`pa_context_set_sink_mute_by_name`](https://freedesktop.org/software/pulseaudio/doxygen/introspect_8h.html). The implementation needs backend/runtime detection across distributions. |
Cross-platform implementation considerations:
- Snapshot the output device identity and prior mute state before changing it; do not implement this as a blind toggle.
- Restore state on every normal completion, cancellation, and error path. Because endpoint mute can survive a process crash, persist enough temporary state for best-effort recovery on the next launch.
- Handle default-device changes during capture, especially Bluetooth devices switching between high-quality playback and headset profiles when the microphone opens.
- Check whether the selected device actually exposes a writable mute control. If not, report that the option is unavailable rather than silently changing volume.
- Avoid overwriting a mute-state change the user makes manually while voice capture is active.
Muting all system playback would be simpler and more predictable than targeting individual applications such as Spotify. Per-application muting could be considered separately but varies more significantly by platform and audio backend.
Hướng dẫn đóng góp
Hướng nghiên cứu
Không có tệp, bài kiểm thử hoặc điểm vào nào được nêu tên. Hãy bắt đầu bằng cách xác định các luồng hiện có để bắt đầu, hoàn tất, hủy và xử lý lỗi của quá trình thu giọng nói, sau đó xác định các tích hợp âm thanh của nền tảng. Công việc được xem là hoàn tất khi một tính năng tắt tiếng tùy chọn chụp lại thiết bị đầu ra và trạng thái tắt tiếng, khôi phục chúng an toàn trên mọi luồng thoát, đồng thời xử lý các thay đổi thiết bị và các điều khiển tắt tiếng không khả dụng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Lĩnh vực
- audio-video-rtc, desktop
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 30/100