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

pa_volume_t pa_sw_volume_from_dB ( double  f  ) 

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

Since:
0.4

Definition at line 85 of file volume.c.

References PA_VOLUME_MUTED, PA_VOLUME_NORM, and pa_volume_t.

                                            {
    if (dB <= -USER_DECIBEL_RANGE)
        return PA_VOLUME_MUTED;

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


Generated by  Doxygen 1.6.0   Back to index