Add a missing pa_xfree.
[pulseaudio.git] / src / tests / voltest.c
blobdcc1ec51b937ba5a2d3ed33348014aff791d3666
1 /* $Id$ */
3 #include <stdio.h>
5 #include <pulse/volume.h>
6 #include <pulsecore/gccmacro.h>
8 int main(PA_GCC_UNUSED int argc, PA_GCC_UNUSED char *argv[]) {
9 pa_volume_t v;
11 for (v = PA_VOLUME_MUTED; v <= PA_VOLUME_NORM*2; v += 256) {
13 double dB = pa_sw_volume_to_dB(v);
14 double f = pa_sw_volume_to_linear(v);
16 printf("Volume: %3i; percent: %i%%; decibel %0.2f; linear = %0.2f; volume(decibel): %3i; volume(linear): %3i\n",
17 v, (v*100)/PA_VOLUME_NORM, dB, f, pa_sw_volume_from_dB(dB), pa_sw_volume_from_linear(f));
21 return 0;