common code: Add feature to record received audio and replay it

-W <file.wav> writes a wave file of received audio
-R <file.wav> reads a wave file to feed into decoder

This way you can record a phone and later debug without a phone
and radio equipment.
This commit is contained in:
Andreas Eversberg
2016-03-25 13:58:16 +01:00
parent 0aa749d27b
commit 1146537d84
16 changed files with 386 additions and 17 deletions

View File

@@ -242,7 +242,7 @@ static void bnetz_timeout(struct timer *timer);
static void bnetz_go_idle(bnetz_t *bnetz);
/* Create transceiver instance and link to a list. */
int bnetz_create(const char *sounddev, int samplerate, int kanal, int gfs, int loopback, double loss_factor, const char *pilot)
int bnetz_create(const char *sounddev, int samplerate, const char *write_wave, const char *read_wave, int kanal, int gfs, int loopback, double loss_factor, const char *pilot)
{
bnetz_t *bnetz;
int use_pilot_tone = -1;
@@ -300,7 +300,7 @@ error_pilot:
PDEBUG(DBNETZ, DEBUG_DEBUG, "Creating 'B-Netz' instance for 'Kanal' = %d 'Gruppenfreisignal' = %d (sample rate %d).\n", kanal, gfs, samplerate);
/* init general part of transceiver */
rc = sender_create(&bnetz->sender, sounddev, samplerate, kanal, loopback, loss_factor, use_pilot_tone);
rc = sender_create(&bnetz->sender, sounddev, samplerate, write_wave, read_wave, kanal, loopback, loss_factor, use_pilot_tone);
if (rc < 0) {
PDEBUG(DBNETZ, DEBUG_ERROR, "Failed to init transceiver process!\n");
goto error;