WIP: Microphone in car - #112
Draft
dragan-n-dream wants to merge 2 commits into
Draft
dragan-n-dream wants to merge 2 commits into
dragan-n-dream wants to merge 2 commits into
Conversation
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
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.
No description provided.