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 control.

class: Volume

Bases: _CommandGroup

Collection of methods for volume and mute control

Source code in camilladsp/camilladsp.py
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
class Volume(_CommandGroup):
    """
    Collection of methods for volume and mute control
    """

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

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

    def set_main(self, value: float):
        """
        Set main volume in dB.
        Equivalent to calling `set_fader()` with `fader=0`.

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

    def fader(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_fader(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_fader_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_fader(self, fader: int, value: float) -> float:
        """
        Adjust volume for the given fader in dB.
        Positive values increase the volume, negative decrease.

        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.

        Returns:
            float: New volume setting.
        """
        _fader, new_vol = self.client.query(
            "AdjustFaderVolume", arg=(int(fader), float(value))
        )
        return float(new_vol)

adjust_fader(fader, value)

Adjust volume for the given fader in dB. Positive values increase the volume, negative decrease.

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

Returns:

Name Type Description
float float

New volume setting.

Source code in camilladsp/camilladsp.py
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
def adjust_fader(self, fader: int, value: float) -> float:
    """
    Adjust volume for the given fader in dB.
    Positive values increase the volume, negative decrease.

    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.

    Returns:
        float: New volume setting.
    """
    _fader, new_vol = self.client.query(
        "AdjustFaderVolume", arg=(int(fader), float(value))
    )
    return float(new_vol)

fader(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/camilladsp.py
551
552
553
554
555
556
557
558
559
560
561
562
563
def fader(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)

main()

Get current main volume setting in dB. Equivalent to calling get_fader_volume() with fader=0.

Returns:

Name Type Description
float float

Current volume setting.

Source code in camilladsp/camilladsp.py
530
531
532
533
534
535
536
537
538
539
def main(self) -> float:
    """
    Get current main volume setting in dB.
    Equivalent to calling `get_fader_volume()` with `fader=0`.

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

set_fader(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/camilladsp.py
565
566
567
568
569
570
571
572
573
574
def set_fader(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_fader_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/camilladsp.py
576
577
578
579
580
581
582
583
584
585
586
587
def set_fader_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)))

set_main(value)

Set main volume in dB. Equivalent to calling set_fader() with fader=0.

Parameters:

Name Type Description Default
value float

New volume in dB.

required
Source code in camilladsp/camilladsp.py
541
542
543
544
545
546
547
548
549
def set_main(self, value: float):
    """
    Set main volume in dB.
    Equivalent to calling `set_fader()` with `fader=0`.

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