FreeCalypso > hg > gsm-codec-lib
changeset 281:3816ba89a5a0
gsmrec-dump: use libgsmfr2 instead of old libgsm
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 14 Apr 2024 05:09:52 +0000 |
parents | 356d9675701d |
children | 9ee8ad3d4d30 |
files | miscutil/Makefile miscutil/gsmrec-dump.c |
diffstat | 2 files changed, 5 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/miscutil/Makefile Sun Apr 14 05:00:19 2024 +0000 +++ b/miscutil/Makefile Sun Apr 14 05:09:52 2024 +0000 @@ -2,14 +2,14 @@ CFLAGS= -O2 PROGS= gsmrec-dump pcm16-check13 pcm16-raw2wav pcm16-to-alaw pcm16-to-ulaw \ pcm16-wav2raw pcm8-to-pcm16 -LIBEFR= ../libgsmefr/libgsmefr.a +LIBEFR= ../libgsmefr/libgsmefr.a ../libgsmfr2/libgsmfr2.a LIBTEST=../libtest/libtest.a INSTBIN=/opt/freecalypso/bin all: ${PROGS} gsmrec-dump: gsmrec-dump.o ${LIBTEST} ${LIBEFR} - ${CC} ${CFLAGS} -o $@ gsmrec-dump.o ${LIBTEST} ${LIBEFR} -lgsm + ${CC} ${CFLAGS} -o $@ gsmrec-dump.o ${LIBTEST} ${LIBEFR} pcm16-check13: pcm16-check13.c ${CC} ${CFLAGS} -o $@ $@.c
--- a/miscutil/gsmrec-dump.c Sun Apr 14 05:00:19 2024 +0000 +++ b/miscutil/gsmrec-dump.c Sun Apr 14 05:09:52 2024 +0000 @@ -6,7 +6,7 @@ #include <stdio.h> #include <stdint.h> #include <stdlib.h> -#include <gsm.h> +#include "../libgsmfr2/tw_gsmfr.h" #include "../libgsmefr/gsm_efr.h" #include "../libtest/binreader.h" @@ -14,10 +14,9 @@ char **argv; { FILE *binf; - gsm dummy_state; unsigned frame_index; uint8_t frame[BINFILE_MAX_FRAME]; - gsm_signal params[76]; + int16_t params[GSMFR_NUM_PARAMS]; int rc, i, j, n; if (argc != 2) { @@ -29,11 +28,6 @@ perror(argv[1]); exit(1); } - dummy_state = gsm_create(); - if (!dummy_state) { - fprintf(stderr, "gsm_create() failed!\n"); - exit(1); - } for (frame_index = 0; ; frame_index++) { rc = binfile_read_frame(binf, frame); if (rc < 0) { @@ -63,7 +57,7 @@ break; case 0xD0: fputs("FR", stdout); - gsm_explode(dummy_state, frame, params); + gsmfr_unpack_to_array(frame, params); n = 0; for (i = 0; i < 8; i++) printf(" %d", params[n++]);