iOS glasses WebRTC client + Mac-mic agent input#2
Open
J4Joshua wants to merge 1 commit into
Open
Conversation
ios/: Meta Ray-Ban glasses app (DAT SDK) with a Pipecat SmallWebRTC client (WebRTCAudioSpike) that connects receive-only to the agent's /api/offer and plays the agent's voice out through the glasses' Bluetooth-HFP speaker. server (bot-courtline.py): optional Mac-microphone input (MAC_MIC_INPUT=1) that feeds InputAudioRawFrames into the pipeline, so the agent listens via the Mac while speaking back over WebRTC to the glasses. No-op when the flag is unset, so the existing browser/WebRTC audio-in path is unaffected. Adds the sounddevice dependency (pyproject + uv.lock). Rationale: WebRTC on iOS can't reliably capture the Bluetooth-HFP glasses mic (and offers no PCM-injection hook for audio), so we capture audio on the Mac and use the glasses for the agent's voice output — which is verified working. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Adds the iOS glasses app and wires audio into the CourtLine agent over WebRTC.
Architecture
Why this shape: WebRTC on iOS can't reliably capture the Bluetooth-HFP glasses mic (it routes to HFP but no samples reach the server), and iOS WebRTC has no supported hook to inject externally-captured PCM into an audio track. So the agent listens via the Mac mic and speaks through the glasses — the output leg is verified working end-to-end.
Changes
ios/— Meta Ray-Ban Display glasses app (DAT SDK).WebRTCAudioSpike.swiftis a Pipecat SmallWebRTC client that connects receive-only (enableMic = false) to the agent's/api/offerand plays the agent's voice through the glasses' HFP speaker. Seeios/README.md.bot-courtline.py— optional Mac-microphone input behindMAC_MIC_INPUT=1: captures the local mic (sounddevice) and feedsInputAudioRawFrames into the pipeline. No-op when unset, so the existing browser/WebRTC audio-in path is unaffected.pyproject.toml/uv.lock— addsounddevice.Verified
xcodebuild -sdk iphonesimulator→ BUILD SUCCEEDED.bot-courtline.pysyntax-checks.Pending (needs the agent's API keys / on-stack run — not CI-able)
check_camera) — the legacy WebSocket video path is left as a placeholder.Setup
Server:
cd yc-voice-agents-hackathon/server && uv sync && MAC_MIC_INPUT=1 uv run main.pyiOS: set
webRTCServerURL(inWebRTCAudioSpike.swift) to the Mac's LAN IP:7860, build on a device on the same Wi-Fi.🤖 Generated with Claude Code