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

pa_volume_t pa_cvolume_avg ( const pa_cvolume a  ) 

Return the average volume of all channels

Definition at line 66 of file volume.c.

References pa_cvolume::channels, pa_volume_t, and pa_cvolume::values.

                                                {
    uint64_t sum = 0;
    int i;
    pa_assert(a);

    for (i = 0; i < a->channels; i++)
        sum += a->values[i];

    sum /= a->channels;

    return (pa_volume_t) sum;
}


Generated by  Doxygen 1.6.0   Back to index