]> git.ipfire.org Git - thirdparty/asterisk.git/commit
audiohook.c: Substitute silence for unavailable audio frames
authorSean Bright <sean.bright@gmail.com>
Fri, 9 Aug 2019 20:53:03 +0000 (16:53 -0400)
committerSean Bright <sean.bright@gmail.com>
Tue, 20 Aug 2019 13:43:39 +0000 (08:43 -0500)
commit51fd43206ba2655233f660f92da2424ffa2ab874
treedb57322bc9c78f7a6349b64e9b348fe1b131a349
parentff180a5bfc3090485ee7b2746ce7bee58e754746
audiohook.c: Substitute silence for unavailable audio frames

There are 4 scenarios to consider when capturing audio from a channel
with an audiohook:

 1. There is no rx and no tx audio, so return nothing.
 2. There is rx but no tx audio, so return rx.
 3. There is tx but no rx audio, so return tx.
 4. There is rx and tx audio, so mix them and return.

The file passed as the primary argument to MixMonitor will be written to
in scenarios 2, 3, and 4. However, if you pass the r() and t() options
to MixMonitor, a frame will only be written to the r() file if there was
rx audio and a frame will only be written to the t() file if there was
tx audio.

If you subsequently take the r() and t() files and try to mix them, the
sides of the conversation will 'drift' and be non-representative of the
user experience.

This patch adds a new 'S' option to MixMonitor that injects a frame of
silence on either the r() side or the t() side of the channel so that
when later mixed, there is no such drift.

Change-Id: Ibf5ed73a811087727bd561a89a59f4447b4ee20e
apps/app_mixmonitor.c
doc/CHANGES-staging/mixmonitor-s-option.txt [new file with mode: 0644]
include/asterisk/audiohook.h
main/audiohook.c