aboutsummaryrefslogtreecommitdiffstats
path: root/src/compress.h
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2006-07-27 00:50:59 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2006-07-27 00:50:59 +0000
commit22b16884a2fb054ed219f07774cc16ec3af34c26 (patch)
tree605a3313d64b7a048c9cab56b2db210eaf7d40a5 /src/compress.h
parentbf5336cebd9e31e0eb0664ef62ce5c6751aa31a3 (diff)
downloadmpd-22b16884a2fb054ed219f07774cc16ec3af34c26.tar.gz
mpd-22b16884a2fb054ed219f07774cc16ec3af34c26.tar.xz
mpd-22b16884a2fb054ed219f07774cc16ec3af34c26.zip
Use AudioCompress for volume normalization
git-svn-id: https://svn.musicpd.org/mpd/trunk@4474 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/compress.h')
-rw-r--r--src/compress.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/compress.h b/src/compress.h
new file mode 100644
index 000000000..1993b47ad
--- /dev/null
+++ b/src/compress.h
@@ -0,0 +1,29 @@
+/* compress.h
+** interface to audio compression
+*/
+
+#ifndef COMPRESS_H
+#define COMPRESS_H
+
+/* These are copied from the AudioCompress config.h, mainly because CompressDo
+ * needs GAINSHIFT defined. The rest are here so they can be used as defaults
+ * to pass to CompressCfg. */
+#define ANTICLIP 0 /* Strict clipping protection */
+#define TARGET 25000 /* Target level */
+#define GAINMAX 32 /* The maximum amount to amplify by */
+#define GAINSHIFT 10 /* How fine-grained the gain is */
+#define GAINSMOOTH 8 /* How much inertia ramping has*/
+#define BUCKETS 400 /* How long of a history to store */
+
+void CompressCfg(int monitor,
+ int anticlip,
+ int target,
+ int maxgain,
+ int smooth,
+ int buckets);
+
+void CompressDo(void *data, unsigned int numSamples);
+
+void CompressFree(void);
+
+#endif