Stream audio to Speech to Text engine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

a few days ago I started experimenting with PJSUA Python binding and now I am able to receive the call and play some WAV file back. But my goal is to receive the call and redirect the incoming RTP stream to Speech to Text engine that gives me the text. As a response I will play WAV recordings back as I get the utterances. The problem is that I am not able to find the right approach. My idea is to modify the SDP payload in callback "Call.onCallSdpCreated" to point to opened Speech-to-Text RTP stream but I have no luck with it. I wanted to simply replace the port in the SDP payload, because the app is running on the same host. Can you maybe suggest how to do that and if I am going the right direction? Or if there is better way then point me towards it?

I already searched in the documentation, GitHub and StackOverflow and the best I could find is https://stackoverflow.com/questions/31023274/how-to-catch-and-translate-incoming-audio-stream-in-other-languages-for-an-ios-c but that feels hacky and I have no idea how would I redirect the stream from that file to socket. Also I need to receive more than one call and I guess all would be mixed in the file so it's no the right way to go.

The code below is my poor try, but I always get some error from Swig. For example: TypeError: Attempt to append a non SwigPyObject

    def onCallSdpCreated(self, prm: pj.OnCallSdpCreatedParam):
        log("SDP created: ", dir(prm.sdp.pjSdpSession))
        log("SDP created: ", prm.sdp.wholeSdp)
        prm.sdp.pjSdpSession.append("m=audio 10000 RTP/AVP 0 101")

Thanks in advance for the answer and thanks for your work :)

_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux