Skip to content

Volume control

This class is accessed via the volume property on a CamillaClient instance.

It provides methods for reading and setting the volume and mute controls.

class: Volume

Bases: _CommandGroup

Collection of methods for volume and mute control

Source code in camilladsp\volume.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
class Volume(_CommandGroup):
    """
    Collection of methods for volume and mute control
    """

    default_min_vol = -150.0
    default_max_vol = 50.0

    def all(self) -> List[Fader]:
        """
        Get volume and mute for all faders with a single call.

        Returns:
            List[Fader]: A list of one object per fader, each with `volume` and `mute` properties.
        """
        faders = self.client.query("GetFaders")
        return faders

    def main_volume(self) -> float:
        """
        Get current main volume setting in dB.
        Equivalent to calling `volume(0)`.

        Returns:
            float: Current volume setting.
        """
        vol = self.client.query("GetVolume")
        return float(vol)

    def set_main_volume(self, value: float):
        """
        Set main volume in dB.
        Equivalent to calling `set_volume(0)`.

        Args:
            value (float): New volume in dB.
        """
        self.client.query("SetVolume", arg=float(value))

    def volume(self, fader: int) -> float:
        """
        Get current volume setting for the given fader in dB.

        Args:
            fader (int): Fader to read.
                Selected using an integer, 0 for `Main` and 1 to 4 for `Aux1` to `Aux4`.

        Returns:
            float: Current volume setting.
        """
        _fader, vol = self.client.query("GetFaderVolume", arg=int(fader))
        return float(vol)

    def set_volume(self, fader: int, vol: float):
        """
        Set volume for the given fader in dB.

        Args:
            fader (int): Fader to control.
                Selected using an integer, 0 for `Main` and 1 to 4 for `Aux1` to `Aux4`.
            vol (float): New volume setting.
        """
        self.client.query("SetFaderVolume", arg=(int(fader), float(vol)))

    def set_volume_external(self, fader: int, vol: float):
        """
        Special command for setting the volume when a "Loudness" filter
        is being combined with an external volume control (without a "Volume" filter).
        Set volume for the given fader in dB.

        Args:
            fader (int): Fader to control.
                Selected using an integer, 0 for `Main` and 1 to 4 for `Aux1` to `Aux4`.
            vol (float): New volume setting.
        """
        self.client.query("SetFaderExternalVolume", arg=(int(fader), float(vol)))

    def adjust_volume(
        self,
        fader: int,
        value: float,
        min_limit: Optional[float] = None,
        max_limit: Optional[float] = None,
    ) -> float:
        """
        Adjust volume for the given fader in dB.
        Positive values increase the volume, negative decrease.
        The resulting volume is limited to the range -150 to +50 dB.
        This default range can be reduced via the optional
        `min_limit` and/or `max_limit` arguments.

        Args:
            fader (int): Fader to control.
                Selected using an integer, 0 for `Main` and 1 to 4 for `Aux1` to `Aux4`.
            value (float): Volume adjustment in dB.
            min_limit (float): Lower volume limit to clamp volume at.
            max_limit (float): Upper volume limit to clamp volume at.


        Returns:
            float: New volume setting.
        """
        arg: Tuple[int, Union[float, Tuple[float, float, float]]]
        if max_limit is not None or min_limit is not None:
            maxlim = max_limit if max_limit is not None else self.default_max_vol
            minlim = min_limit if min_limit is not None else self.default_min_vol
            arg = (int(fader), (float(value), float(minlim), float(maxlim)))
        else:
            arg = (int(fader), float(value))
        _fader, new_vol = self.client.query("AdjustFaderVolume", arg=arg)
        return float(new_vol)

    def main_mute(self) -> bool:
        """
        Get current main mute setting.
        Equivalent to calling `mute(0)`.

        Returns:
            bool: True if muted, False otherwise.
        """
        mute = self.client.query("GetMute")
        return bool(mute)

    def set_main_mute(self, value: bool):
        """
        Set main mute, true or false.
        Equivalent to calling `set_mute(0)`.

        Args:
            value (bool): New mute setting.
        """
        self.client.query("SetMute", arg=bool(value))

    def mute(self, fader: int) -> bool:
        """
        Get current mute setting for a fader.

        Args:
            fader (int): Fader to read.
                Selected using an integer, 0 for `Main` and 1 to 4 for `Aux1` to `Aux4`.

        Returns:
            bool: True if muted, False otherwise.
        """
        _fader, mute = self.client.query("GetFaderMute", arg=int(fader))
        return bool(mute)

    def set_mute(self, fader: int, value: bool):
        """
        Set mute status for a fader, true or false.

        Args:
            fader (int): Fader to control.
                Selected using an integer, 0 for `Main` and 1 to 4 for `Aux1` to `Aux4`.
            value (bool): New mute setting.
        """
        self.client.query("SetFaderMute", arg=(int(fader), bool(value)))

    def toggle_mute(self, fader: int) -> bool:
        """
        Toggle mute status for a fader.

        Args:
            fader (int): Fader to control.
                Selected using an integer, 0 for `Main` and 1 to 4 for `Aux1` to `Aux4`.

        Returns:
            bool: True if the new status is muted, False otherwise.
        """
        _fader, new_mute = self.client.query("ToggleFaderMute", arg=int(fader))
        return new_mute

adjust_volume(fader, value, min_limit=None, max_limit=None)

Adjust volume for the given fader in dB. Positive values increase the volume, negative decrease. The resulting volume is limited to the range -150 to +50 dB. This default range can be reduced via the optional min_limit and/or max_limit arguments.

Parameters:

Name Type Description Default
fader int

Fader to control. Selected using an integer, 0 for Main and 1 to 4 for Aux1 to Aux4.

required
value float

Volume adjustment in dB.

required
min_limit float

Lower volume limit to clamp volume at.

None
max_limit float

Upper volume limit to clamp volume at.

None

Returns:

Name Type Description
float float

New volume setting.

Source code in camilladsp\volume.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
def adjust_volume(
    self,
    fader: int,
    value: float,
    min_limit: Optional[float] = None,
    max_limit: Optional[float] = None,
) -> float:
    """
    Adjust volume for the given fader in dB.
    Positive values increase the volume, negative decrease.
    The resulting volume is limited to the range -150 to +50 dB.
    This default range can be reduced via the optional
    `min_limit` and/or `max_limit` arguments.

    Args:
        fader (int): Fader to control.
            Selected using an integer, 0 for `Main` and 1 to 4 for `Aux1` to `Aux4`.
        value (float): Volume adjustment in dB.
        min_limit (float): Lower volume limit to clamp volume at.
        max_limit (float): Upper volume limit to clamp volume at.


    Returns:
        float: New volume setting.
    """
    arg: Tuple[int, Union[float, Tuple[float, float, float]]]
    if max_limit is not None or min_limit is not None:
        maxlim = max_limit if max_limit is not None else self.default_max_vol
        minlim = min_limit if min_limit is not None else self.default_min_vol
        arg = (int(fader), (float(value), float(minlim), float(maxlim)))
    else:
        arg = (int(fader), float(value))
    _fader, new_vol = self.client.query("AdjustFaderVolume", arg=arg)
    return float(new_vol)

all()

Get volume and mute for all faders with a single call.

Returns:

Type Description
List[Fader]

List[Fader]: A list of one object per fader, each with volume and mute properties.

Source code in camilladsp\volume.py
21
22
23
24
25
26
27
28
29
def all(self) -> List[Fader]:
    """
    Get volume and mute for all faders with a single call.

    Returns:
        List[Fader]: A list of one object per fader, each with `volume` and `mute` properties.
    """
    faders = self.client.query("GetFaders")
    return faders

main_mute()

Get current main mute setting. Equivalent to calling mute(0).

Returns:

Name Type Description
bool bool

True if muted, False otherwise.

Source code in camilladsp\volume.py
125
126
127
128
129
130
131
132
133
134
def main_mute(self) -> bool:
    """
    Get current main mute setting.
    Equivalent to calling `mute(0)`.

    Returns:
        bool: True if muted, False otherwise.
    """
    mute = self.client.query("GetMute")
    return bool(mute)

main_volume()

Get current main volume setting in dB. Equivalent to calling volume(0).

Returns:

Name Type Description
float float

Current volume setting.

Source code in camilladsp\volume.py
31
32
33
34
35
36
37
38
39
40
def main_volume(self) -> float:
    """
    Get current main volume setting in dB.
    Equivalent to calling `volume(0)`.

    Returns:
        float: Current volume setting.
    """
    vol = self.client.query("GetVolume")
    return float(vol)

mute(fader)

Get current mute setting for a fader.

Parameters:

Name Type Description Default
fader int

Fader to read. Selected using an integer, 0 for Main and 1 to 4 for Aux1 to Aux4.

required

Returns:

Name Type Description
bool bool

True if muted, False otherwise.

Source code in camilladsp\volume.py
146
147
148
149
150
151
152
153
154
155
156
157
158
def mute(self, fader: int) -> bool:
    """
    Get current mute setting for a fader.

    Args:
        fader (int): Fader to read.
            Selected using an integer, 0 for `Main` and 1 to 4 for `Aux1` to `Aux4`.

    Returns:
        bool: True if muted, False otherwise.
    """
    _fader, mute = self.client.query("GetFaderMute", arg=int(fader))
    return bool(mute)

set_main_mute(value)

Set main mute, true or false. Equivalent to calling set_mute(0).

Parameters:

Name Type Description Default
value bool

New mute setting.

required
Source code in camilladsp\volume.py
136
137
138
139
140
141
142
143
144
def set_main_mute(self, value: bool):
    """
    Set main mute, true or false.
    Equivalent to calling `set_mute(0)`.

    Args:
        value (bool): New mute setting.
    """
    self.client.query("SetMute", arg=bool(value))

set_main_volume(value)

Set main volume in dB. Equivalent to calling set_volume(0).

Parameters:

Name Type Description Default
value float

New volume in dB.

required
Source code in camilladsp\volume.py
42
43
44
45
46
47
48
49
50
def set_main_volume(self, value: float):
    """
    Set main volume in dB.
    Equivalent to calling `set_volume(0)`.

    Args:
        value (float): New volume in dB.
    """
    self.client.query("SetVolume", arg=float(value))

set_mute(fader, value)

Set mute status for a fader, true or false.

Parameters:

Name Type Description Default
fader int

Fader to control. Selected using an integer, 0 for Main and 1 to 4 for Aux1 to Aux4.

required
value bool

New mute setting.

required
Source code in camilladsp\volume.py
160
161
162
163
164
165
166
167
168
169
def set_mute(self, fader: int, value: bool):
    """
    Set mute status for a fader, true or false.

    Args:
        fader (int): Fader to control.
            Selected using an integer, 0 for `Main` and 1 to 4 for `Aux1` to `Aux4`.
        value (bool): New mute setting.
    """
    self.client.query("SetFaderMute", arg=(int(fader), bool(value)))

set_volume(fader, vol)

Set volume for the given fader in dB.

Parameters:

Name Type Description Default
fader int

Fader to control. Selected using an integer, 0 for Main and 1 to 4 for Aux1 to Aux4.

required
vol float

New volume setting.

required
Source code in camilladsp\volume.py
66
67
68
69
70
71
72
73
74
75
def set_volume(self, fader: int, vol: float):
    """
    Set volume for the given fader in dB.

    Args:
        fader (int): Fader to control.
            Selected using an integer, 0 for `Main` and 1 to 4 for `Aux1` to `Aux4`.
        vol (float): New volume setting.
    """
    self.client.query("SetFaderVolume", arg=(int(fader), float(vol)))

set_volume_external(fader, vol)

Special command for setting the volume when a "Loudness" filter is being combined with an external volume control (without a "Volume" filter). Set volume for the given fader in dB.

Parameters:

Name Type Description Default
fader int

Fader to control. Selected using an integer, 0 for Main and 1 to 4 for Aux1 to Aux4.

required
vol float

New volume setting.

required
Source code in camilladsp\volume.py
77
78
79
80
81
82
83
84
85
86
87
88
def set_volume_external(self, fader: int, vol: float):
    """
    Special command for setting the volume when a "Loudness" filter
    is being combined with an external volume control (without a "Volume" filter).
    Set volume for the given fader in dB.

    Args:
        fader (int): Fader to control.
            Selected using an integer, 0 for `Main` and 1 to 4 for `Aux1` to `Aux4`.
        vol (float): New volume setting.
    """
    self.client.query("SetFaderExternalVolume", arg=(int(fader), float(vol)))

toggle_mute(fader)

Toggle mute status for a fader.

Parameters:

Name Type Description Default
fader int

Fader to control. Selected using an integer, 0 for Main and 1 to 4 for Aux1 to Aux4.

required

Returns:

Name Type Description
bool bool

True if the new status is muted, False otherwise.

Source code in camilladsp\volume.py
171
172
173
174
175
176
177
178
179
180
181
182
183
def toggle_mute(self, fader: int) -> bool:
    """
    Toggle mute status for a fader.

    Args:
        fader (int): Fader to control.
            Selected using an integer, 0 for `Main` and 1 to 4 for `Aux1` to `Aux4`.

    Returns:
        bool: True if the new status is muted, False otherwise.
    """
    _fader, new_mute = self.client.query("ToggleFaderMute", arg=int(fader))
    return new_mute

volume(fader)

Get current volume setting for the given fader in dB.

Parameters:

Name Type Description Default
fader int

Fader to read. Selected using an integer, 0 for Main and 1 to 4 for Aux1 to Aux4.

required

Returns:

Name Type Description
float float

Current volume setting.

Source code in camilladsp\volume.py
52
53
54
55
56
57
58
59
60
61
62
63
64
def volume(self, fader: int) -> float:
    """
    Get current volume setting for the given fader in dB.

    Args:
        fader (int): Fader to read.
            Selected using an integer, 0 for `Main` and 1 to 4 for `Aux1` to `Aux4`.

    Returns:
        float: Current volume setting.
    """
    _fader, vol = self.client.query("GetFaderVolume", arg=int(fader))
    return float(vol)