summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2016-12-11 18:39:35 +0100
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2016-12-11 18:39:35 +0100
commit7633fd079039a893a006b4ff8d8b770f4f912463 (patch)
treeda87df0bca2dc1cda287212c4145e3de922cb4be /modules
parent99d29fa5d666288574111cadfb2d7150209cffe9 (diff)
aufile: convert samples from LE to Host-order
Diffstat (limited to 'modules')
-rw-r--r--modules/aufile/aufile.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/aufile/aufile.c b/modules/aufile/aufile.c
index 9422b7a..185feb9 100644
--- a/modules/aufile/aufile.c
+++ b/modules/aufile/aufile.c
@@ -110,6 +110,8 @@ static int read_file(struct ausrc_st *st)
int err;
for (;;) {
+ uint16_t *sampv;
+ size_t i;
mb = mbuf_alloc(4096);
if (!mb)
@@ -126,6 +128,12 @@ static int read_file(struct ausrc_st *st)
break;
}
+ /* convert from Little-Endian to Native-Endian */
+ sampv = (void *)mb->buf;
+ for (i=0; i<mb->end/2; i++) {
+ sampv[i] = sys_ltohs(sampv[i]);
+ }
+
aubuf_append(st->aubuf, mb);
mb = mem_deref(mb);