]> code.delx.au - pulseaudio/commitdiff
print smallest attenuation/sample
authorLennart Poettering <lennart@poettering.net>
Wed, 8 Apr 2009 01:47:18 +0000 (03:47 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 8 Apr 2009 01:47:18 +0000 (03:47 +0200)
src/tests/voltest.c

index 0c6d2ea6ae73a1340cdbc9ee2203ebe1766ba1ef..2dcfa53cdce2367ba782fa06c4ce6e8a10d5706a 100644 (file)
@@ -9,6 +9,9 @@ int main(int argc, char *argv[]) {
     float b;
     pa_channel_map map;
 
+    printf("Attenuation of sample 1 against 32767: %g dB\n", 20.0*log10(1.0/32767.0));
+    printf("Smallest possible attenutation > 0 applied to 32767: %li\n", lrint(32767.0*pa_sw_volume_to_linear(1)));
+
     for (v = PA_VOLUME_MUTED; v <= PA_VOLUME_NORM*2; v += 256) {
 
         double dB = pa_sw_volume_to_dB(v);