Check the canvas.js and multiopus.js demos: they will give you a practical example of how that works, since they both take a stream from a canvas and use it in createOffer.
Hello Lorenzo,
in canvas.js , you capture canvas stream and add an audio track, and pass the canvas stream to createOffer.
In videoroom.js (0.x), we don’t have the video stream, only the deviceID. And getting the video stream supposes a new asynchronous call to getUserMedia using in constraints the videoDeviceId.
The aplication combines videoroom demo with device selection demo.
I don’t know if there would be another way to combine the video with its videDeviceId with the audio track obtained from the new stream.
Using 1.x, seems that you can combine tracks by their deviceId with tracks with their stream. (I’m not sure about it). But migrating the application to 1.x is too much work for me. There are various applications using janus 0.x on the same server and I would have to modify all of them.
My final solution has been to use getUserMedia with selected devices in constraints and with the returned stream replace the audio with processed audio and pass it to createOffer.
It seems to work well.