mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-17 03:07:24 -05:00
WAV: Fix Issues with Per Call;
Fix Per Call Issue introduced with commit re-enabling single static wav file where single channel audio decode types would not write to per call temp wav files and be deleted after event history cycled them;
Fix Issue with YSF where double writes would occur in .wav files;
Fix Issue with M17 where incorrect rate audio would write to static .wav file by converting to stereo output;
Seperate Per Call and Create Method to Allow EDACS Analog Calls to be written to static wav file by downsampling and stereo interleaving audio to proper spec;
Issues were introduced in commit # c7b25c60af
This commit is contained in:
47
src/m17.c
47
src/m17.c
@@ -425,11 +425,25 @@ void M17processCodec2_1600(dsd_opts * opts, dsd_state * state, uint8_t * payload
|
||||
|
||||
}
|
||||
|
||||
//WIP: Wav file saving -- still need a way to open/close/label wav files similar to call history
|
||||
if(opts->wav_out_f != NULL && state->m17_enc == 0) //WAV
|
||||
//Wav file saving
|
||||
if(opts->wav_out_f != NULL && state->m17_enc == 0 && opts->dmr_stereo_wav == 1) //Per Call
|
||||
{
|
||||
sf_write_short(opts->wav_out_f, samp1, nsam);
|
||||
}
|
||||
else if (opts->wav_out_f != NULL && state->m17_enc == 0 && opts->static_wav_file == 1) //Static Wav File
|
||||
{
|
||||
//convert to stereo for new static wav file setup
|
||||
short ss[nsam*2];
|
||||
memset (ss, 0, sizeof(ss));
|
||||
|
||||
for (i = 0; i < nsam; i++)
|
||||
{
|
||||
ss[(i*2)+0] = samp1[i];
|
||||
ss[(i*2)+1] = samp1[i];
|
||||
}
|
||||
|
||||
sf_write_short(opts->wav_out_f, ss, nsam*2);
|
||||
}
|
||||
|
||||
//TODO: Codec2 Raw file saving
|
||||
// if(mbe_out_dir)
|
||||
@@ -559,12 +573,37 @@ void M17processCodec2_3200(dsd_opts * opts, dsd_state * state, uint8_t * payload
|
||||
|
||||
}
|
||||
|
||||
//WIP: Wav file saving -- still need a way to open/close/label wav files similar to call history
|
||||
if(opts->wav_out_f != NULL && state->m17_enc == 0) //WAV
|
||||
//Wav file saving
|
||||
if(opts->wav_out_f != NULL && state->m17_enc == 0 && opts->dmr_stereo_wav == 1) //WAV
|
||||
{
|
||||
sf_write_short(opts->wav_out_f, samp1, nsam);
|
||||
sf_write_short(opts->wav_out_f, samp2, nsam);
|
||||
}
|
||||
else if (opts->wav_out_f != NULL && state->m17_enc == 0 && opts->static_wav_file == 1) //Static Wav File
|
||||
{
|
||||
//convert to stereo for new static wav file setup
|
||||
short ss[nsam*2];
|
||||
memset (ss, 0, sizeof(ss));
|
||||
|
||||
for (i = 0; i < nsam; i++)
|
||||
{
|
||||
ss[(i*2)+0] = samp1[i];
|
||||
ss[(i*2)+1] = samp1[i];
|
||||
}
|
||||
|
||||
sf_write_short(opts->wav_out_f, ss, nsam*2);
|
||||
|
||||
memset (ss, 0, sizeof(ss));
|
||||
|
||||
for (i = 0; i < nsam; i++)
|
||||
{
|
||||
ss[(i*2)+0] = samp2[i];
|
||||
ss[(i*2)+1] = samp2[i];
|
||||
}
|
||||
|
||||
sf_write_short(opts->wav_out_f, ss, nsam*2);
|
||||
|
||||
}
|
||||
|
||||
//TODO: Codec2 Raw file saving
|
||||
// if(mbe_out_dir)
|
||||
|
||||
Reference in New Issue
Block a user