app_mixmonitor: Fix duplex recording for non 8K codecs

The native sampling of duplex recording is set to match the raw 8K
output format. If one or more of the streams being recorded is above
8K, the frame size coming into the mixmonitor is too large and needs
to be translated to 8K before being mixed into the stereo frame to
avoid garbled and mistimed audio

Fixes: #1779
This commit is contained in:
Mike Bradeen
2026-06-16 14:19:01 +00:00
parent 169ca3e491
commit 4ed0a1cd67
2 changed files with 109 additions and 11 deletions
+3
View File
@@ -176,6 +176,9 @@ struct ast_frame *ast_audiohook_read_frame(struct ast_audiohook *audiohook, size
* \param write_frame if available, we'll copy the write buffer to this.
* \return frame on success
* \retval NULL on failure
* \note The read_frame and write_frame may be in a different format from what was specified in format depending on the sample rate
* of the hooked channel's codec - ie; if we are requesting slin, but are hooked on channel using a 16K codec like g722, the
* read and write frames will be slin16.
*/
struct ast_frame *ast_audiohook_read_frame_all(struct ast_audiohook *audiohook, size_t samples, struct ast_format *format, struct ast_frame **read_frame, struct ast_frame **write_frame);