Logo Search packages:      
Sourcecode: pulseaudio version File versions

pa_volume_t pa_sw_volume_from_linear ( double  v  ) 

Convert a linear factor to a volume. This is only valid for software volumes!

Definition at line 132 of file volume.c.

References PA_VOLUME_MUTED, and PA_VOLUME_NORM.

                                               {

    if (v <= 0)
        return PA_VOLUME_MUTED;

    if (v > .999 && v < 1.001)
        return PA_VOLUME_NORM;

    return pa_sw_volume_from_dB(20*log10(v));
}


Generated by  Doxygen 1.6.0   Back to index