From 6eaa308552f428ddc2cc2496a7e96e48652908c9 Mon Sep 17 00:00:00 2001 From: paulc Date: Tue, 3 Nov 2020 11:30:40 +0000 Subject: [PATCH] Added support for WB and UWB audio formats. git-svn-id: http://yate.null.ro/svn/yate/trunk@6451 acf43c95-373e-0410-b603-e72c3f656dc1 --- modules/mux.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/mux.cpp b/modules/mux.cpp index e67fd85a..f06cc6d9 100644 --- a/modules/mux.cpp +++ b/modules/mux.cpp @@ -5,7 +5,7 @@ * Data multiplex * * Yet Another Telephony Engine - a fully featured software PBX and IVR - * Copyright (C) 2004-2014 Null Team + * Copyright (C) 2004-2020 Null Team * * This software is distributed under multiple licenses; * see the COPYING file in the main directory for licensing @@ -160,9 +160,15 @@ static MuxModule plugin; // Dictionary containig the supported formats and sample lengths static const TokenDict s_dictSampleLen[] = { - {"mulaw", 1}, - {"alaw", 1}, - {"slin", 2}, + {"mulaw", 1}, + {"mulaw/16000", 1}, + {"mulaw/32000", 1}, + {"alaw", 1}, + {"alaw/16000", 1}, + {"alaw/32000", 1}, + {"slin", 2}, + {"slin/16000", 2}, + {"slin/32000", 2}, {0,0}, }; @@ -272,6 +278,10 @@ MuxSource::MuxSource(const String& id, const char* targetid, const char* format, m_idleValue = params.getIntValue("idlevalue",s_idleValue); unsigned int chanBuffer = params.getIntValue("chanbuffer",s_chanBuffer); + if (getFormat().endsWith("/16000")) + chanBuffer *= 2; + else if (getFormat().endsWith("/32000")) + chanBuffer *= 4; // Adjust channel buffer to be multiple of sample length and not lesser then it if (chanBuffer < m_sampleLen)