Re: [w3c/gamepad] Add support for a PCM buffer to the gamepad actuator (Issue #186)

nondebug left a comment (w3c/gamepad#186)

Windows GameInput documentation seems like a good starting point for standardization since it leverages existing system-level audio capabilities instead of introducing a new API:

https://learn.microsoft.com/en-us/gaming/gdk/docs/features/common/input/hardware/input-hardware-haptics

GameInput says gamepad haptics are provided by a haptic audio endpoint with up to 8 channels, mapped to haptic locations by a registry key. Applying this to Gamepad API, we could represent a gamepad's haptic capabilities as a set of haptic locations mapped to AudioDestinationNodes.

https://www.w3.org/TR/webaudio-1.1/#AudioDestinationNode

Maybe something like:

```
enum GamepadHapticAudioLocation {
  "grip-left",  // GAMEINPUT_HAPTIC_LOCATION_GRIP_LEFT
  "grip-right", // GAMEINPUT_HAPTIC_LOCATION_GRIP_RIGHT
  "trigger-left", // GAMEINPUT_HAPTIC_LOCATION_TRIGGER_LEFT
  "trigger-right" // GAMEINPUT_HAPTIC_LOCATION_TRIGGER_RIGHT
};

partial interface Gamepad {
  // Represents the gamepad's haptic audio capabilities
  readonly attribute FrozenArray<GamepadHapticAudioLocation> hapticAudioLocations;
  // Try to get the audio destination node.
  Promise<AudioDestinationNode> getHapticAudioDestinationNode(GamepadHapticAudioLocation location);
};
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/gamepad/issues/186#issuecomment-3648568355
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/gamepad/issues/186/3648568355@github.com>

Received on Saturday, 13 December 2025 00:11:42 UTC