diff --git a/README.md b/README.md index 8b1a7942..759befc3 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ view inside the editor. ## Features -- Supports streaming both iOS simulators and Android emulators +- Supports streaming iOS simulators and Android emulators, including WebRTC audio - Full simulator control & inspection using private iOS accessibility APIs and Android UIAutomator - available using `simdeck` CLI - Real-time screen `describe` command using accessibility view tree - available in token-efficient format for agents - Profiling built-in: CPU, memory, disk writes, network throughput, hang signals, and stack sampling diff --git a/docs/api/rest.md b/docs/api/rest.md index 5e5828fa..14469902 100644 --- a/docs/api/rest.md +++ b/docs/api/rest.md @@ -173,7 +173,7 @@ Performance query parameters: | `GET` | `/api/simulators/{udid}/control` | Alias for input control WebSocket | | `POST` | `/api/simulators/{udid}/refresh` | Request a fresh frame or keyframe | -For normal clients, copy the browser behavior instead of hand-coding a raw decoder. The UI supports WebRTC first and H.264 WebSocket fallback. +For normal clients, copy the browser behavior instead of hand-coding a raw decoder. The UI supports WebRTC first and H.264 WebSocket fallback. WebRTC carries H.264 video and, when the offer includes an audio receiver, an Opus simulator-audio track sourced from the selected simulator or emulator process tree. The H.264 WebSocket fallback is video-only. Minimal WebRTC request: @@ -194,7 +194,16 @@ Response: ```json { "type": "answer", - "sdp": "v=0..." + "sdp": "v=0...", + "audio": { + "codec": "opus", + "sampleRate": 48000, + "channels": 2 + }, + "video": { + "width": 1179, + "height": 2556 + } } ``` diff --git a/docs/guide/video.md b/docs/guide/video.md index 372ca1b4..b1a4ee4c 100644 --- a/docs/guide/video.md +++ b/docs/guide/video.md @@ -4,6 +4,10 @@ SimDeck streams live device video to the browser. Local sessions default to high iOS simulator H.264 uses VideoToolbox for hardware encoding and x264 for software encoding. +WebRTC streams also include simulator audio. The browser menu exposes a Sound +toggle so viewers can keep playback muted until they want to hear the device. +H.264 WebSocket fallback remains video-only. + ## When encoding runs SimDeck starts encoding when a browser stream needs H.264 frames. The server @@ -73,6 +77,17 @@ simdeck service restart --video-codec software --low-latency The browser tries WebRTC first. If WebRTC cannot render a frame, the UI can fall back to H.264 over WebSocket when the browser supports WebCodecs. +Audio is carried on the WebRTC path using a browser-native Opus track. On +macOS 14.2 and newer, SimDeck uses Core Audio process taps over the selected +simulator or emulator process tree, then routes that tap through a private +aggregate device into the WebRTC audio track. If macOS has not granted system +audio recording access, video still streams and the server logs the +audio-capture failure. While the tap is being read, Core Audio mutes the tapped +simulator process at the hardware output; browser playback is controlled by the +Sound toggle. Android emulators launched by SimDeck are started with host audio +enabled, so restart older no-audio emulator processes before testing Android +sound. + Force a mode while debugging: ```text diff --git a/packages/client/index.html b/packages/client/index.html index be7538db..72c8f4b7 100644 --- a/packages/client/index.html +++ b/packages/client/index.html @@ -24,5 +24,29 @@
+