Simple volume control.
More...
Simple volume control.
This is a very simple software volume control.
◆ gavl_volume_control_t
Opaque structure for a volume control.
You don't want to know what's inside.
◆ gavl_volume_control_create()
Create volume control.
- Returns
- A newly allocated volume control
◆ gavl_volume_control_destroy()
Destroys a volume control and frees all associated memory.
- Parameters
-
◆ gavl_volume_control_set_format()
Set format for a volume control.
- Parameters
-
| ctrl | A volume control |
| format | The format subsequent frames will be passed with This function can be called multiple times with one instance |
◆ gavl_volume_control_set_volume()
Set volume for a volume control.
- Parameters
-
| ctrl | A volume control |
| volume | Volume in dB (must be <= 0.0 to prevent overflows) |
◆ gavl_volume_control_apply()
Apply a volume control for an audio frame.
- Parameters
-
| ctrl | A volume control |
| frame | An audio frame |
◆ gavl_volume_to_int()
| GAVL_PUBLIC int gavl_volume_to_int |
( |
float | volume, |
|
|
float | one, |
|
|
int | steps ) |
Convert an audio volume (in dB) to an integer.
- Parameters
-
| volume | dB value |
| one | The dB value corresponding to an integer value of 1 |
| steps | The number of steps |
- Returns
- Volume as integer
◆ gavl_volume_to_float()
| GAVL_PUBLIC float gavl_volume_to_float |
( |
int | volume, |
|
|
float | one, |
|
|
int | steps ) |
Convert an integer audio volume to a float (in dB).
- Parameters
-
| volume | Integer value |
| one | The dB value corresponding to an integer value of 1 |
| steps | The number of steps |
- Returns
- Volume in dB