From: drowe67 Date: Tue, 4 Jun 2013 03:09:08 +0000 (+0000) Subject: play raw file out of discovery working X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=4b654aa3f4c28ed50ec571710e3fc2d7d68ec131;p=freetel-svn-tracking.git play raw file out of discovery working git-svn-id: https://svn.code.sf.net/p/freetel/code@1308 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/src/fifo.c b/codec2-dev/src/fifo.c index be4995e8..566d77ab 100644 --- a/codec2-dev/src/fifo.c +++ b/codec2-dev/src/fifo.c @@ -100,7 +100,6 @@ int fifo_read(struct FIFO *fifo, short data[], int n) { int i; short *pdata; - short *pin = fifo->pin; short *pout = fifo->pout; assert(fifo != NULL); diff --git a/codec2-dev/stm32/src/dac_play.c b/codec2-dev/stm32/src/dac_play.c index 43263ec7..3e08abbd 100644 --- a/codec2-dev/stm32/src/dac_play.c +++ b/codec2-dev/stm32/src/dac_play.c @@ -35,34 +35,33 @@ #define fread gdb_stdio_fread #define fwrite gdb_stdio_fwrite -#define N1 24000 -#define N2 320 +#define N 2000 int main(void) { - short *buf, *pbuf; + short buf[N]; FILE *fin; - int i, nframes; - buf = (short*)malloc(N1*sizeof(short)); dac_open(); - fin = fopen("stm_in.raw", "rb"); - if (fin == NULL) { - printf("Error opening input file: stm_in.raw\n\nTerminating....\n"); - exit(1); - } - fread(buf, sizeof(short), N1, fin); - fclose(fin); - - nframes = N1/N2; while(1) { + fin = fopen("stm_in.raw", "rb"); + if (fin == NULL) { + printf("Error opening input file: stm_in.raw\n\nTerminating....\n"); + exit(1); + } + printf("Starting!\n"); - pbuf = buf; - for(i=0; i