Switching capture device and playback device

MD
Matthew Danielson
Fri, Apr 7, 2017 4:44 AM

My goal is to create a simple phone that "captures" from the playback
device (for example, during a call I open up a YouTube video and the
other party hears the audio from that) and "plays back" to the
microphone (if I were to record from the microphone in an audio
application, what the other party is saying would be recorded). In other
words, the capture_dev and playback_dev are switched.

It seemed PJSIP was a great solution, but sadly through my research it
seems you can only set devices (which encompass both capture and record)
and PJSIP internally determines which to use. I've seen examples of
loop-back and looked at the media stack, but I don't think that's
possible to accomplish my goals.

I've mostly looked at the python library as my C knowledge is pretty
rough, but I'm willing to try and hack it if there's a solution in the
raw library. I'm just worried it's not possible to do this, and would
like some guidance from the experts before diving in to something I'm
not well versed in.

Appreciated

Matt

My goal is to create a simple phone that "captures" from the playback device (for example, during a call I open up a YouTube video and the other party hears the audio from that) and "plays back" to the microphone (if I were to record from the microphone in an audio application, what the other party is saying would be recorded). In other words, the capture_dev and playback_dev are switched. It seemed PJSIP was a great solution, but sadly through my research it seems you can only set devices (which encompass both capture and record) and PJSIP internally determines which to use. I've seen examples of loop-back and looked at the media stack, but I don't think that's possible to accomplish my goals. I've mostly looked at the python library as my C knowledge is pretty rough, but I'm willing to try and hack it if there's a solution in the raw library. I'm just worried it's not possible to do this, and would like some guidance from the experts before diving in to something I'm not well versed in. Appreciated Matt