Logo Search packages:      
Sourcecode: pulseaudio version File versions  Download package

pa_volume_t pa_sw_volume_from_linear ( double  v  ) 

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

Since:
0.8

Definition at line 99 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