FreeCalypso > hg > gsm-codec-lib
changeset 288:e0b46ac2c326
gsmfr-encode-r: convert to libgsmfr2
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 14 Apr 2024 06:20:04 +0000 |
parents | f00925b533b7 |
children | 18229558c8bf |
files | frtest/Makefile frtest/encode-r.c |
diffstat | 2 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/frtest/Makefile Sun Apr 14 06:16:47 2024 +0000 +++ b/frtest/Makefile Sun Apr 14 06:20:04 2024 +0000 @@ -28,8 +28,8 @@ gsmfr-encode: encode.o ${LIBTEST} ${LIBFR2} ${CC} ${CFLAGS} -o $@ encode.o ${LIBTEST} ${LIBFR2} -gsmfr-encode-r: encode-r.o ${LIBTEST} - ${CC} ${CFLAGS} -o $@ encode-r.o ${LIBTEST} -lgsm +gsmfr-encode-r: encode-r.o ${LIBTEST} ${LIBFR2} + ${CC} ${CFLAGS} -o $@ encode-r.o ${LIBTEST} ${LIBFR2} gsmfr-preproc: preproc.o ${LIBDEC} ${CC} ${CFLAGS} -o $@ preproc.o ${LIBDEC}
--- a/frtest/encode-r.c Sun Apr 14 06:16:47 2024 +0000 +++ b/frtest/encode-r.c Sun Apr 14 06:20:04 2024 +0000 @@ -7,20 +7,20 @@ #include <stdio.h> #include <stdint.h> #include <stdlib.h> -#include <gsm.h> +#include "../libgsmfr2/tw_gsmfr.h" #include "../libtest/roberead.h" main(argc, argv) char **argv; { FILE *inf, *binf; - gsm enc_state; + struct gsmfr_0610_state *enc_state; int16_t pcm[160]; uint8_t frame[33]; int rc; if (argc != 3) { - fprintf(stderr, "usage: %s input.wav output.gsm\n", argv[0]); + fprintf(stderr, "usage: %s input.robe output.gsm\n", argv[0]); exit(1); } inf = fopen(argv[1], "r"); @@ -33,16 +33,16 @@ perror(argv[2]); exit(1); } - enc_state = gsm_create(); + enc_state = gsmfr_0610_create(); if (!enc_state) { - fprintf(stderr, "gsm_create() failed!\n"); + fprintf(stderr, "gsmfr_0610_create() failed!\n"); exit(1); } for (;;) { rc = robe_get_pcm_block(inf, pcm); if (!rc) break; - gsm_encode(enc_state, pcm, frame); + gsmfr_0610_encode_frame(enc_state, pcm, frame); fwrite(frame, 1, sizeof frame, binf); } fclose(binf);