mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-20 12:45:40 -05:00
M17 - Misc Tweaks;
This commit is contained in:
20
src/m17.c
20
src/m17.c
@@ -1257,6 +1257,17 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state)
|
|||||||
short sample = 0; //individual audio sample from source
|
short sample = 0; //individual audio sample from source
|
||||||
size_t nsam = 160; //number of samples to be read in (default is for codec2 3200 bps)
|
size_t nsam = 160; //number of samples to be read in (default is for codec2 3200 bps)
|
||||||
|
|
||||||
|
//if saving a wav file of baseband audio, insert initial dead air time
|
||||||
|
if (opts->wav_out_raw != NULL)
|
||||||
|
{
|
||||||
|
memset (empty, 0, 1920*sizeof(short)); //bugfix
|
||||||
|
for (i = 0; i < 20; i++)
|
||||||
|
{
|
||||||
|
sf_write_short(opts->wav_out_raw, empty, 1920);
|
||||||
|
sf_write_sync (opts->wav_out_raw);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//WIP: Open UDP port to 17000 and see if any other config info is necessary for running standard IP frames, etc,
|
//WIP: Open UDP port to 17000 and see if any other config info is necessary for running standard IP frames, etc,
|
||||||
//or perhaps just also configure an input format for that ip streaming method, may need to handle UDP control packets (conn, ackn, nack, ping, pong, disc)
|
//or perhaps just also configure an input format for that ip streaming method, may need to handle UDP control packets (conn, ackn, nack, ping, pong, disc)
|
||||||
int sock_err;
|
int sock_err;
|
||||||
@@ -1937,6 +1948,15 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state)
|
|||||||
// for (i = 0; i < 14; i++)
|
// for (i = 0; i < 14; i++)
|
||||||
// fprintf (stderr, " %02X", nonce[i]);
|
// fprintf (stderr, " %02X", nonce[i]);
|
||||||
|
|
||||||
|
//Viterbi decoder seems to respond better to non-zero fill, so, when no enc is used
|
||||||
|
//let's set the lsf_es to 2 for RES, and fill the nonce value with repeating 0x69
|
||||||
|
if (lsf_et == 0)
|
||||||
|
{
|
||||||
|
lsf_es = 3; //RES
|
||||||
|
for (i = 0; i < 14; i++)
|
||||||
|
nonce[i] = 0x69;
|
||||||
|
}
|
||||||
|
|
||||||
//load the nonce from packed bytes to a bitwise iv array
|
//load the nonce from packed bytes to a bitwise iv array
|
||||||
memset(iv, 0, sizeof(iv));
|
memset(iv, 0, sizeof(iv));
|
||||||
k = 0;
|
k = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user