SDL_GetAudioDeviceGain(3)

SDL_GetAudioDeviceGain3

Get the gain of an audio device.

Usage

#include "SDL3/SDL.h"

float SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid);

Header file

Defined in SDL3/SDL_audio.h

Overview

The gain of a device is its volume; a larger gain means a louder output, with a gain of zero being silence.

Audio devices default to a gain of 1.0f (no change in output).

Physical devices may not have their gain changed, only logical devices, and this function will always return -1.0f when used on physical devices.

Function parameters

devid

the audio device to query.

Return value

Returns the gain of the device or -1.0f on failure; call

SDL_GetError () for more information.

Thread safety

It is safe to call this function from any thread.

Availability

This function is available since SDL 3.2.0.

From libsdl3-doc 3.2.10+ds-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.