changeset 287:f00925b533b7

gsmfr-encode: convert to libgsmfr2
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 14 Apr 2024 06:16:47 +0000
parents 251aed72925e
children e0b46ac2c326
files frtest/Makefile frtest/encode.c
diffstat 2 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/frtest/Makefile	Sun Apr 14 06:11:39 2024 +0000
+++ b/frtest/Makefile	Sun Apr 14 06:16:47 2024 +0000
@@ -25,8 +25,8 @@
 gsmfr-dlcap-parse:	dlcap-parse.o tidsp.o ${LIBTEST} ${LIBFR2}
 	${CC} ${CFLAGS} -o $@ dlcap-parse.o tidsp.o ${LIBTEST} ${LIBFR2}
 
-gsmfr-encode:	encode.o ${LIBTEST}
-	${CC} ${CFLAGS} -o $@ encode.o ${LIBTEST} -lgsm
+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
--- a/frtest/encode.c	Sun Apr 14 06:11:39 2024 +0000
+++ b/frtest/encode.c	Sun Apr 14 06:16:47 2024 +0000
@@ -5,7 +5,7 @@
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
-#include <gsm.h>
+#include "../libgsmfr2/tw_gsmfr.h"
 #include "../libtest/wavreader.h"
 #include "../libtest/wavrdhelp.h"
 
@@ -14,7 +14,7 @@
 {
 	void *wav;
 	FILE *binf;
-	gsm enc_state;
+	struct gsmfr_0610_state *enc_state;
 	int16_t pcm[160];
 	uint8_t frame[33];
 	int rc;
@@ -36,16 +36,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 = wavrd_get_pcm_block(wav, 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);