Skip to content

feat(webrtc): Implement microphone support for cloud sessions#121

Merged
zortos293 merged 8 commits intodevfrom
capy/feat-add-mic-support
Feb 18, 2026
Merged

feat(webrtc): Implement microphone support for cloud sessions#121
zortos293 merged 8 commits intodevfrom
capy/feat-add-mic-support

Conversation

@zortos293
Copy link
Collaborator

Description

This PR introduces full microphone support, enabling voice chat functionality within cloud gaming sessions. The implementation follows the approach observed in the official GeForce NOW client for compatibility and robustness.

Key changes include:

  • MicrophoneManager: A new class to handle microphone capture, permissions, device enumeration, and state management, mirroring official client behavior.
  • WebRTC Integration: The GfnWebRtcClient now manages the microphone stream, adding it to the WebRTC peer connection and handling its lifecycle (start, stop, toggle).
  • SDP Modification: The Session Description Protocol (SDP) generation has been updated to enable the microphone media line, allowing the client to send audio to the cloud gaming server.
  • User Interface:
    • A new microphone toggle button is added to the StreamView for quick mute/unmute access.
    • SettingsPage now includes options to configure microphone mode (disabled, push-to-talk, voice activity) and select the input device.
  • Settings Persistence: Microphone preferences are saved and loaded via the SettingsManager.

Review with Capy

@zortos293 zortos293 added the capy Generated by capy.ai label Feb 18, 2026 — with Capy AI
zortos293 and others added 7 commits February 18, 2026 18:17
- Added session.setPermissionRequestHandler for microphone permissions
- Added session.setPermissionCheckHandler for microphone checks
- Added macOS systemPreferences.askForMediaAccess on startup
- Fixed SettingsPage to enumerate actual microphone devices
- Added Mic icon to settings UI
- Shows permission error if mic access is denied

Co-authored-by: Capy <capy@capy.ai>
…ermission

- Added check in onWindowBlur to skip key release during mic permission request
- This prevents mouse/keyboard input from breaking when getUserMedia() causes brief focus loss
- The micState === 'permission_pending' check keeps keys pressed during the permission dialog

Co-authored-by: Capy <capy@capy.ai>
…eaming

- Added useEffect in App.tsx to restore focus to video element when navigating away from Settings
- This fixes mouse/pointer lock and fullscreen issues when using F8 or clicking buttons
- The focus was being lost to Settings page inputs and not restored

Co-authored-by: Capy <capy@capy.ai>
…screen

- Added local ref management with setVideoRef callback
- Added useEffect to auto-focus video element when stream is ready
- Added onClick handler to focus video when clicked
- This ensures pointer lock and fullscreen work correctly when interacting with stream

Co-authored-by: Capy <capy@capy.ai>
- Allowed fullscreen, automatic-fullscreen, pointerLock, and speaker-selection permissions
- Prevents Electron permission handler from blocking requestFullscreen/pointerLock
- Fixes user-gesture fullscreen and pointer lock failures in stream

Co-authored-by: Capy <capy@capy.ai>
…yboard lock

- Attach mic track after remote description and target mid=3 recvonly transceiver
- Added MicrophoneManager.attachTrackToPeerConnection for late attachment
- Allowed keyboardLock permission in Electron handlers
- Improves mic audio send and keyboard lock during fullscreen

Co-authored-by: Capy <capy@capy.ai>
@zortos293 zortos293 merged commit da99ed9 into dev Feb 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant