Skip to content

WIP: Microphone in car - #112

Draft
dragan-n-dream wants to merge 2 commits into
masterfrom
drg/microphone-changes
Draft

dragan-n-dream wants to merge 2 commits into
masterfrom
drg/microphone-changes

Conversation

@dragan-n-dream

Copy link
Copy Markdown
Contributor

No description provided.

claude added 2 commits August 20, 2026 10:42
A phone controller connected to a car often captures through the car's
Bluetooth microphone, which takes the audio focus away and makes the platform
pause the session. To let the platform offer another microphone instead, the
API gains a vocabulary for audio inputs:

- setAudioInputDevices(devices, activeDeviceId) reports the controller's audio
  inputs and the device the current stream uses. It accepts the result of
  enumerateDevices() as is and reduces each entry to { deviceId, label,
  groupId }, since nothing else survives postMessage cloning usefully.
- onAudioInputDeviceChange(device_id) is called when the player picked another
  microphone on the platform, so the game can reopen its stream on it.
- getUserMedia also sends microphoneRequested, which the platform correlates
  with the audio focus it loses.

setAudioInputDevice is handled before the mediaPermissionPending_ guard in the
inbound event handler: that guard drops stale messages of a settled permission
request, and device selection happens long after, with no request pending.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KB3fBY6FZ4i3utrTgAvy3a
Temporary instrumentation to track the data flow while investigating why a
controller in a car still pauses after it obtained a microphone stream.
Logs the microphoneRequested send, the stream-open event the platform uses as
its second anchor, the reported devices and the inbound device selection.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KB3fBY6FZ4i3utrTgAvy3a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants