Recently Written · git

sad

sad (2f30.org simple audio daemon) with a Cygwin/OSS port on branch cygwin

git clone https://github.com/equwal/sad

Log | Files | Refs


commit 12aabfe54a62fa1bde142de980849a1ab94b22f3
sin <sin@2f30.org>
2014-12-30 17:46:14 +0000

Allow resampling quality to be tweaked via config.h

 config.def.h | 2 ++
 output.c     | 3 +--
 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/config.def.h b/config.def.h
index 116eee9..b4595e0 100644
--- a/config.def.h
+++ b/config.def.h
@@ -1,3 +1,5 @@
+#define RESAMPLEQUALITY SOXR_VHQ /* very high quality, higher cpu usage */
+
 Outputdesc outputdescs[] = {
 	{ "sndio", 16, 44100, 2, 0, 0, &sndiooutput, NULL, -1 },
 	{ "alsa" , 16, 44100, 2, 1, 0, &alsaoutput,  NULL, -1 },
diff --git a/output.c b/output.c
index 444e900..ef16366 100644
--- a/output.c
+++ b/output.c
@@ -31,8 +31,7 @@ initresampler(Outputdesc *desc, int inrate)
 	soxr_io_spec_t      iospec;
 	int i;
 
-	/* TODO: resampling quality should be configurable in config.h */
-	quality = soxr_quality_spec(SOXR_VHQ, 0);
+	quality = soxr_quality_spec(RESAMPLEQUALITY, 0);
 	iospec = soxr_io_spec(SOXR_INT16_I, SOXR_INT16_I);
 	if (desc->resampler)
 		soxr_delete(desc->resampler);