unispeech / unimrcp

Open source cross-platform implementation of MRCP protocol
http://www.unimrcp.org
Apache License 2.0
374 stars 165 forks source link

Unimrcpclient does not respect the codecs #326

Open flaviogoncalves opened 6 months ago

flaviogoncalves commented 6 months ago

I'm trying to use G722 to avoid resampling to 16khz. Unfortunately, it does not matter how I try in the client, the system only offers PCMU. I'm trying to call Asterisk with PCMU or G722 and have the leg to unimrcpserver with G722 or another PCM 16Khz. If Asterisk can do the resampling on the fly it is better then doing on the plugin. Currently I'm using the latest unimrcp library and Asterisk 16.

Contents of /opt/unimrcp/unimrcpclient.xml

<ptime>20</ptime>
<codecs>**G722** PCMU telephone-event/101/8000</codecs>

Contents of the SDP offer from the Asterisk Server SDP Offer with only PCMU

v=0 o=UniMRCPClient 0 0 IN IP4 192.168.1.11 s=- c=IN IP4 192.168.1.11 t=0 0 m=application 9 TCP/MRCPv2 1 a=setup:active a=connection:new a=resource:speechrecog a=cmid:1 m=audio 4004 RTP/AVP 0 101 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000

Contents of the console in the unimrcpserver 2024-03-22 22:41:15:137547 [INFO] Open RTP Receiver 192.168.1.11:5000 <- 192.168.1.11:4002 playout [50 ms] bounds [0 - 600 ms] adaptive [1] skew detection [1] 2024-03-22 22:41:15:137552 [INFO] Media Path 0x7f3394001d08 Source->[PCMU/8000/1]->Decoder->[LPCM/8000/1]->Bridge->[LPCM/8000/1]->Sink 2024-03-22 22:41:15:137606 [INFO] Send Answer 0x7f3394001d08 [c:1 a:1 v:0] Status OK