FreeCalypso > hg > vband-misc
comparison pcmu2efr/pcmu-input.c @ 26:1794bf0fbcf7
pcmu2efr: emit full PCMU input
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 12 May 2024 04:48:36 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
25:1f58ba0d79a4 | 26:1794bf0fbcf7 |
---|---|
1 /* | |
2 * This program emits the full sequence (3 EHFs and 2 copies of seqsyncu) | |
3 * that needs to be fed to TRAU DL input from G.711 PCMU side to perform | |
4 * the test of reversing the EFR variant used and finding frame sync. | |
5 */ | |
6 | |
7 #include <stdio.h> | |
8 #include <stdint.h> | |
9 #include <stdlib.h> | |
10 #include <string.h> | |
11 #include <strings.h> | |
12 | |
13 extern const uint8_t seqsyncu_last_frame[160]; | |
14 | |
15 main(argc, argv) | |
16 char **argv; | |
17 { | |
18 FILE *outf; | |
19 uint8_t ehf[160]; | |
20 | |
21 if (argc != 2) { | |
22 fprintf(stderr, "usage: %s pcmu-out-file\n", argv[0]); | |
23 exit(1); | |
24 } | |
25 outf = fopen(argv[1], "w"); | |
26 if (!outf) { | |
27 perror(argv[1]); | |
28 exit(1); | |
29 } | |
30 memset(ehf, 0xFE, 160); | |
31 fwrite(ehf, 1, 160, outf); | |
32 fwrite(ehf, 1, 160, outf); | |
33 fwrite(ehf, 1, 160, outf); | |
34 fwrite(seqsyncu_last_frame, 1, 160, outf); | |
35 fwrite(seqsyncu_last_frame, 1, 160, outf); | |
36 fclose(outf); | |
37 exit(0); | |
38 } |