aboutsummaryrefslogtreecommitdiffstats
path: root/utils.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-09-22 21:38:37 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-09-22 21:38:37 +0200
commit01bcfc5d692236bffeec5b8de2c27138e71d2bd6 (patch)
treecaeef2a186acb074388484f78c4445353afe5ac1 /utils.h
parenta0bbc1d61bff38e5db76d3e11813551977411543 (diff)
downloadtoolame-dab-01bcfc5d692236bffeec5b8de2c27138e71d2bd6.tar.gz
toolame-dab-01bcfc5d692236bffeec5b8de2c27138e71d2bd6.tar.bz2
toolame-dab-01bcfc5d692236bffeec5b8de2c27138e71d2bd6.zip
Add -L option to print level
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/utils.h b/utils.h
new file mode 100644
index 0000000..7d98ab6
--- /dev/null
+++ b/utils.h
@@ -0,0 +1,20 @@
+#ifndef _UTILS_H_
+#define _UTILS_H_
+
+#include <math.h>
+#include <stdint.h>
+
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#define MAX(a,b) (((a)>(b))?(a):(b))
+
+#define NUMOF(l) (sizeof(l) / sizeof(*l))
+
+#define linear_to_dB(x) (log10(x) * 20)
+
+/* Calculate the little string containing a bargraph
+ * 'VU-meter' from the peak value measured
+ */
+const char* level(int channel, int* peak);
+
+#endif
+