---
name: "set_hardware_volume"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/set_hardware_volume"
---

# set\_hardware\_volume(3alleg)

Alters the hardware sound output volume. Allegro game programming library.

## NAME

set\_hardware\_volume - Alters the hardware sound output volume. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**void set\_hardware\_volume(int digi\_volume, int midi\_volume);**

## DESCRIPTION

Alters the hardware sound output volume. Specify volumes for both digital  samples and MIDI playback, as integers from 0 to 255, or pass a negative  value to leave one of the settings unchanged. Values bigger than 255 will be reduced to 255. This routine will use the hardware mixer to control the volume if it exists (i.e. the volume of all the applications on your machine will be affected), otherwise do nothing.

## SEE ALSO

[**install\_sound**(3alleg)](/install_sound/3alleg.md), [**set\_volume**(3alleg)](/set_volume/3alleg.md)
