What I am trying to do:
I am trying to connect Asterisk to a custom unimrcp plugin for doing ASR. The ASR service can accept only 16khz data and cannot be changed.
Where I am as of now:
In asterisk-> pjsip.conf, if I configure a 16khz codec (like G722), then my Plugin, ASR service etc. receive the data correctly and I’ve been able to get it working end to end via Zoiper(Desktop app).
However, I am not able to get it working for an 8khz codec like ulaw or alaw.
What I want to understand?
If I want to support 8khz audio, where should the conversion to 16khz audio happen?
- Option A : Is it possible to convert the data from a 8khz codec to 16khz codec within asterisk itself so that UniMRCP plugin always receives data in 16khz format?
- Option B : Should it be done in the UniMRCP plugin that I am writing so that my plugin supports both 16khz and 8khz data?
Also, for whichever option you suggest, can you please share some references on how to get started with it? I’ve tried implementing Option B using ffmpeg to convert the MRCP data stream to the required format, but couldn’t understand much to get a sample working.