Module lua_libpulse_glib.volume
Bindings for libpulse’s pa_cvolume
.
Contrary to libpulse, methods that change the a Volume object generally don’t return anything, but instead change the instance itself.
Table of contents
Static Functions
new(values) | Creates an instance of Volume. |
is_valid(value) | Checks whether a value is a valid Volume. |
from_dB(value) | Converts a decibel value to an integer volume value. |
to_dB(value) | Converts an integer volume value to a decibel value. |
from_linear(value) | Converts a linear factor to an integer volume value. |
to_linear(value) | Converts an integer volume value to linear factor. |
Class Volume
Volume:avg() | Returns the average volume over all channels. |
Volume:channels_equal_to(value) | Returns true if the volume of all channels is equal to the specified value. |
Volume:dec(value) | Decreases the volume by the given amount. |
Volume:divide(value) | Divides the volume by the given value. |
Volume:get(index) | Returns the volume of a single channel. |
Volume:inc(value) | Increases the volume by the given amount. |
Volume:is_muted() | Returns true when all channels are muted. |
Volume:is_norm() | Returns true when all channels are on normal level. |
Volume:max() | Returns the maximum volume out of all channels. |
Volume:min() | Returns the minimum volume out of all channels. |
Volume:multiply(value) | Multiplies the volume by the given amount. |
Volume:mute() | Mutes all channels. |
Volume:reset() | Resets all channels to normal volume. |
Volume:scale(value) | Scales all channels to the passed amount. |
Volume:set(index, value) | Sets a channel to the given value. |
Volume:set_channels(channels, value) | Sets a number of channels to the given volume value. |
Static Functions
Parameters:
-
values : An array of channel volumes.
Returns:
Parameters:
-
value : The value to check
Returns:
This is only valid for software volumes. It does not operate on instances of Volume.
Parameters:
-
value
Returns:
This is only valid for software volumes. It does not operate on instances of Volume.
Parameters:
-
value
Returns:
0.0
and less is muted, 1.0
is normal volume.
This is only valid for software volumes. It does not operate on instances of Volume.
Parameters:
-
value
Returns:
This is only valid for software volumes. It does not operate on instances of Volume.
Parameters:
-
value
Returns:
Class Volume
Returns:
true
if the volume of all channels is equal to the specified value.Parameters:
-
value : Volume to compare to
Returns:
The proportions between the channels are kept.
Parameters:
-
value : The value to decrease by.
The value to divide by may either be a scalar, that’s applied to all channels, or another instance of Volume, which would be applied channel by channel.
It is possible to divide a Volume by itself.
This is only valid for software volumes.
Parameters:
-
value : The volume to divide by.
Parameters:
-
index : The channel index
Returns:
-
The channel’s volume
The proportions between the channels are kept.
Parameters:
-
value : the value to increase by.
true
when all channels are muted.Returns:
true
when all channels are on normal level.Returns:
Returns:
Returns:
The value to multiply with may either be a scalar, that’s applied to all channels, or another instance of Volume, which would be applied channel by channel.
It is possible to multiply a Volume by itself.
This is only valid for software volumes.
Parameters:
-
value
This adjust all channel volumes so that the maximum between them equals the given value, while keeping proportions between channels the same.
Parameters:
-
value : The value to scale to.
Parameters:
-
index : The channel index.
-
value : The volume to set to.
Parameters:
-
channels : The number of channels to set
-
value : The volume to set to.