You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I send a SET_USER_VOICE_SETTINGS command to my RPC application (using pypresence library), the volume value I'm sending is not the one displayed on my discord client. Valeurs discord.xlsx
Steps to Reproduce
Create a application and connect to it in RPC
Send a SET_USER_VOICE_SETTINGS command with arg : "volume" = [int between 0 and 200]
Expected Behavior
Sending the value "volume" to my client
Current Behavior
Values not corresponding even though API is answering with the value I sent
Screenshots/Videos
You can find attached an excel file with the value I sent and the one displayed on Discord Client
Client and System Information
Using pypresence and python on a W11 machine
The text was updated successfully, but these errors were encountered:
Here is the Payload schema sent by pypresence library :
`def set_user_voice_settings(cls, user_id: str, pan_left: float = None,
pan_right: float = None, volume: int = None,
mute: bool = None):
payload = {
"cmd": "SET_USER_VOICE_SETTINGS",
"args": {
"user_id": str(user_id),
"pan": {
"left": pan_left,
"right": pan_right
},
"volume": volume,
"mute": mute
},
"nonce": '{:.20f}'.format(cls.time())
}
print (payload)
return cls(payload, True)`
And here is the payload for a user in my vocal: { "cmd": "SET_USER_VOICE_SETTINGS", "args": { "user_id": "933262680758825011", "pan": { "left": null, "right": null }, "volume": 29, "mute": null }, "nonce": "1736411427.93830204010009765625" }
Note: it changed the volume of the user to 78 on my discord client
This is by-design. The Discord UI exposes a "perceptual" volume level, which has a non-linear relationship with the actual underlying amplitude. The exact function used for the conversion isn't specified, and may change in the future; RPC clients shouldn't rely on it. The APC API exposes the underlying linear amplitude value, so its behavior is guaranteed to remain stable. If exposing this value to a user in a slider or similar UI element, I'd suggest applying your own perceptual curve (a power function with an exponent between 2 and 5 tends to work well; the exact optimal curve depends on your design).
Description
When I send a SET_USER_VOICE_SETTINGS command to my RPC application (using pypresence library), the volume value I'm sending is not the one displayed on my discord client.
Valeurs discord.xlsx
Steps to Reproduce
Expected Behavior
Sending the value "volume" to my client
Current Behavior
Values not corresponding even though API is answering with the value I sent
Screenshots/Videos
You can find attached an excel file with the value I sent and the one displayed on Discord Client
Client and System Information
Using pypresence and python on a W11 machine
The text was updated successfully, but these errors were encountered: