mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 20:28:11 +00:00
Base+Utilities: Add the asctl audio utility, replacing avol
The new asctl (audio server control) utility expands on avol with a completely new command line interface (documented in the man page) that supports retrieving and setting all exposed audio server settings, like volume and sample rate. This is currently the only user-facing way of changing the sample rate.
This commit is contained in:
parent
f99e6507ee
commit
7d7d310df6
5 changed files with 219 additions and 87 deletions
61
Base/usr/share/man/man1/asctl.md
Normal file
61
Base/usr/share/man/man1/asctl.md
Normal file
|
@ -0,0 +1,61 @@
|
|||
## Name
|
||||
|
||||
asctl - Send control signals to the audio server and hardware
|
||||
|
||||
## Synopsis
|
||||
|
||||
```**sh
|
||||
$ asctl [--human-readable] <command> [args...]
|
||||
```
|
||||
|
||||
## Description
|
||||
|
||||
This program is used to send control signals to the AudioServer and the sound hardware. This allows changing audio server variables like volume and mute state, as well as querying the state of these variables.
|
||||
|
||||
## Options
|
||||
|
||||
* `-h`, `--human-readable`: Print human-readable output. If this option is not given, the output of `get` will be machine-readable and only consist of one line.
|
||||
|
||||
## Arguments
|
||||
|
||||
* `command`: The command to execute, either `get` or `set`.
|
||||
* `args`: The arguments to the command.
|
||||
|
||||
There are two commands available: `get` reports the state of audio variables, and `set` changes these variables.
|
||||
|
||||
`get` expects a list of variables to report back, and it will report them in the order given. The exact format of the report depends on the `--human-readable` flag. If no variables are given, `get` will report all available variables, in the order that they are listed below.
|
||||
|
||||
`set` expects one or more variables followed by a value to set them to, and will set the variables to the given values. A variable can be given multiple times and the last specified value will remain with the audio server.
|
||||
|
||||
The available variables are:
|
||||
* `(v)olume`: Audio server volume, in percent. Integer value.
|
||||
* `(m)ute`: Mute state. Boolean value, may be set with `0`, `false` or `1`, `true`.
|
||||
* `sample(r)ate`: Sample rate of the sound card. **Attention:** Most audio applications need to be restarted after changing the sample rate. Integer value.
|
||||
|
||||
Both commands and arguments can be abbreviated: Commands by their first letter, arguments by the letter in parenthesis.
|
||||
|
||||
## Examples
|
||||
|
||||
```**sh
|
||||
Get the current volume (machine format)
|
||||
$ asctl get volume
|
||||
100
|
||||
|
||||
Get all variables
|
||||
$ asctl -h get
|
||||
Volume: 100
|
||||
Muted: No
|
||||
Sample rate: 48000 Hz
|
||||
|
||||
Set the volume to 100%
|
||||
$ asctl set volume 100
|
||||
|
||||
Mute all audio
|
||||
$ asctl set mute true
|
||||
|
||||
Unmute all audio, set volume to 80%
|
||||
$ asctl s m 0 v 80
|
||||
|
||||
Set sample rate
|
||||
$ asctl s samplerate 48000
|
||||
```
|
|
@ -1,36 +0,0 @@
|
|||
## Name
|
||||
|
||||
avol - Change system sound volume
|
||||
|
||||
## Synopsis
|
||||
|
||||
```**sh
|
||||
$ avol [-m] [-M] [volume]
|
||||
```
|
||||
|
||||
## Description
|
||||
|
||||
This program is used to control the AudioServer volume and muted state.
|
||||
|
||||
## Options
|
||||
|
||||
* `-m`: Mute all audio.
|
||||
* `-M`: Unmute all audio.
|
||||
|
||||
## Examples
|
||||
|
||||
```sh
|
||||
# Set the volume to 100
|
||||
$ avol 100
|
||||
Volume: 100
|
||||
|
||||
# Get the current volume
|
||||
$ avol
|
||||
Volume: 80
|
||||
|
||||
# Mute all audio
|
||||
$ avol -m
|
||||
|
||||
# Unmute all audio
|
||||
$ avol -M
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue