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

cabanier 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.

So you have an 8 channel audio stream in the system and then this stream is distributed it to haptic locations? 
Would a user then send an audio stream for each haptic actuator? 
It seems associating one stream with one actuator would accomplish the same thing but maybe I'm missing something...

> 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);
> };
> ```

Couldn't we add this `GamepadHapticAudioLocation` to the haptic actuator?
I'm a bit worried that we'll need a lot of enums to describe the location of the actuators. Maybe we can define the location as a simple string instead?



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

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

Received on Monday, 15 December 2025 21:39:09 UTC