comparison libtest/robewrite.c @ 153:14b627682458

gsmfr-decode-r utility put together
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 14 Dec 2022 23:11:20 +0000
parents libtest/pcmwrite.c@a3aa152c4653
children
comparison
equal deleted inserted replaced
152:a217a6eacbad 153:14b627682458
1 /*
2 * Here we implement our PCM write helper function for "robe" format.
3 */
4
5 #include <stdio.h>
6 #include <stdint.h>
7 #include "robewrite.h"
8
9 void write_pcm_to_robe(FILE *outf, const int16_t *pcm)
10 {
11 uint8_t bytes[320], *dp;
12 int16_t samp;
13 unsigned n;
14
15 dp = bytes;
16 for (n = 0; n < 160; n++) {
17 samp = pcm[n];
18 *dp++ = (samp >> 8) & 0xFF;
19 *dp++ = samp & 0xFF;
20 }
21 fwrite(bytes, 2, 160, outf);
22 }