Logo Search packages:      
Sourcecode: pulseaudio version File versions

pa_volume_t pa_sw_volume_divide ( pa_volume_t  a,
pa_volume_t  b 

Divide two volume specifications, return the result. This uses PA_VOLUME_NORM as neutral element of division. This is only valid for software volumes! If a division by zero is tried the result will be 0.


Definition at line 107 of file volume.c.

    double v = pa_sw_volume_to_linear(b);

    if (v <= 0)
        return 0;

    return pa_sw_volume_from_linear(pa_sw_volume_to_linear(a) / v);

Generated by  Doxygen 1.6.0   Back to index