aboutsummaryrefslogtreecommitdiff
path: root/sio.c
diff options
context:
space:
mode:
Diffstat (limited to 'sio.c')
-rw-r--r--sio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sio.c b/sio.c
index 414de7c..6e76f8f 100644
--- a/sio.c
+++ b/sio.c
@@ -17,6 +17,7 @@
#include <assert.h>
#include <err.h>
+#include <sndint.h>
#include <sndio.h>
#include <stdlib.h>
@@ -100,9 +101,10 @@ read_sio(double *left, double *right, size_t n)
*/
data = (struct data *)(p - rndsz);
+ /* split and normalize */
for (i = 0; i < n; i++) {
- left[i] = data[i].left;
- right[i] = data[i].right;
+ left[i] = data[i].left / (double)INT16_MAX;
+ right[i] = data[i].right / (double)INT16_MAX;
}
return n;