flutter-webrtc icon indicating copy to clipboard operation
flutter-webrtc copied to clipboard

Flutter WebRTC cannot capture desktop audio (system sound) on Windows/macOS

Open vhunkalo opened this issue 5 months ago • 1 comments

Description

I am trying to capture desktop audio (system sound) along with screen capture in a Flutter desktop application using flutter_webrtc.

Currently, the following approach works for video and microphone input:

final stream = await navigator.mediaDevices.getDisplayMedia({
  'video': { 'mandatory': { 'maxWidth': 1280, 'maxHeight': 720, 'maxFramerate': 30 } },
  'audio': true
});


Steps to reproduce
	1.	Run a Flutter desktop app on Windows/macOS.
	2.	Call getDisplayMedia({ video: {...}, audio: true }).
	3.	Play some system audio (e.g., YouTube, music player).
	4.	Inspect stream.getAudioTracks() — system audio is missing.

⸻

Expected behavior
	•	System audio (audio output) should be captured in the MediaStream along with screen video.
	•	Similar to Electron’s desktopCapturer with audio: 'loopback'.

⸻

Actual behavior
	•	Only microphone audio is captured.
	•	Desktop/system audio is not accessible.
	•	No native flags or parameters in flutter_webrtc allow capturing audio output.

vhunkalo avatar Nov 13 '25 11:11 vhunkalo

@pan1nx @jezell @LinusU @davidliu

vhunkalo avatar Nov 13 '25 11:11 vhunkalo

same problem here @pan1nx @davidliu @jezell

EigenIsCoding avatar Dec 19 '25 08:12 EigenIsCoding