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

@@ -283,7 +283,7 @@ static void nmt_timeout(struct timer *timer);
static void nmt_go_idle(nmt_t *nmt);
/* Create transceiver instance and link to a list. */
int nmt_create(const char *sounddev, int samplerate, int channel, enum nmt_chan_type chan_type, uint8_t ms_power, uint8_t traffic_area, uint8_t area_no, int compander, int supervisory, int loopback)
int nmt_create(const char *sounddev, int samplerate, const char *write_wave, const char *read_wave, int channel, enum nmt_chan_type chan_type, uint8_t ms_power, uint8_t traffic_area, uint8_t area_no, int compander, int supervisory, int loopback)
{
nmt_t *nmt;
int rc;
@@ -324,7 +324,7 @@ int nmt_create(const char *sounddev, int samplerate, int channel, enum nmt_chan_
PDEBUG(DNMT, DEBUG_DEBUG, "Creating 'NMT' instance for channel = %d (sample rate %d).\n", channel, samplerate);
/* init general part of transceiver */
rc = sender_create(&nmt->sender, sounddev, samplerate, channel, loopback, 0, -1);
rc = sender_create(&nmt->sender, sounddev, samplerate, write_wave, read_wave, channel, loopback, 0, -1);
if (rc < 0) {
PDEBUG(DNMT, DEBUG_ERROR, "Failed to init transceiver process!\n");
goto error;