Logo Search packages:      
Sourcecode: pulseaudio version File versions

pa_volume_t pa_sw_volume_from_dB ( double  f  ) 

Convert a decibel value to a volume. This is only valid for software volumes!

Definition at line 118 of file volume.c.

References PA_VOLUME_MUTED, PA_VOLUME_NORM, and pa_volume_t.

    if (isinf(dB) < 0 || dB <= -USER_DECIBEL_RANGE)
        return PA_VOLUME_MUTED;

    return (pa_volume_t) lrint((dB/USER_DECIBEL_RANGE+1)*PA_VOLUME_NORM);

Generated by  Doxygen 1.6.0   Back to index