summaryrefslogtreecommitdiffstats
path: root/src/utils.h
blob: c7ddc1e94140e4dedf4d8dc029dd68cc36c3be5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef UTILS_H_
#define UTILS_H_

#include <math.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)


const char* level(int channel, int* peak);

#endif